New issue
Advanced search Search tips

Issue 848999 link

Starred by 3 users

Issue metadata

Status: Duplicate
Merged: issue v8:7801
Owner: ----
Closed: Jun 2018
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 2
Type: Bug-Regression



Sign in to add a comment

tagged Templates specifications violation

Reported by andrea.g...@gmail.com, Jun 2 2018

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_4) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/11.1 Safari/605.1.15

Steps to reproduce the problem:
1. open the JS console and write the following
2. (function(s){ return s; })`a` === (function(s){ return s; })`a`
3. read `false` instead of `true`

What is the expected behavior?
From ECMAScript specifications:
https://www.ecma-international.org/ecma-262/8.0/index.html#sec-gettemplateobject

Each TemplateLiteral in the program code of a realm is associated with a unique template object that is used in the evaluation of tagged Templates (12.2.9.5). The template objects are frozen and the same template object is used each time a specific tagged Template is evaluated.

What went wrong?
Starting from Chrome 67 you cannot understand anymore from a tagged function if the template has been used already or not per realm.

Did this work before? Yes Chrome 66 + NodeJS 9

Chrome version: Version 67.0.3396.62 (Official Build) (64-bit)  Channel: stable
OS Version: OS X 10.13.4
Flash Version: 

Please put back the behavior that has been expected and used for the last 2 years, and that still works as such in Safari (or other browsers), thank you.
 
Please note that even Babel JS transpire that behavior when template literals are encountered, so this change is badly affecting every JS code that trust that behavior, including NodeJS which had correct behavior in version 6, 8, and 9, but 10 breaks.

The babel example where nobody should see the alert.
https://babeljs.io/repl/#?babili=false&browsers=&build=&builtIns=false&code_lz=JYMwBAFAUGkgrgOwMYBdgHtEQM4EoBvMAJwFNV5jEwcBuMAXzwAMBDZsAQgF5uY4kaTNnxEyFKjXpM2zKHjCsANqWKoIAcgAqAC1JhgiVKsTkDOMACNiGANalEGvLSA&debug=false&forceAllTransforms=false&shippedProposals=false&circleciRepo=&evaluate=true&fileSize=false&lineWrap=false&presets=es2015&prettier=false&targets=&version=6.26.0&envVersion=
FYI this is a pull request to test262 to avoid this ever happening again in the future:
https://github.com/tc39/test262/pull/1581
Labels: Needs-Triage-M67
Mergedinto: v8:7801
Status: Duplicate (was: Unconfirmed)

Sign in to add a comment