Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Normative: Add missing GetValue() to TemplateLiteral evaluation #1298

Merged
merged 1 commit into from Sep 6, 2018

Conversation

TimothyGu
Copy link
Member

@TimothyGu TimothyGu commented Aug 30, 2018

As currently spec'd, it is an undefined behavior when an Expression that evaluates to a Reference is present in a TemplateLiteral, as the Reference value would be directly passed into ToString which expects an ECMAScript language value.

Fixes #935.


Quite similar to #1286.

@TimothyGu TimothyGu added normative change Affects behavior required to correctly evaluate some ECMAScript source text spec bug labels Aug 30, 2018
spec.html Outdated
1. Let _sub_ be the result of evaluating |Expression|.
1. ReturnIfAbrupt(_sub_).
1. Let _subRef_ be the result of evaluating |Expression|.
1. ReturnIfAbrupt(_subRef_).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this line isn't needed, since it's covered by step 1 of https://tc39.github.io/ecma262/#sec-getvalue

spec.html Outdated
1. Let _sub_ be the result of evaluating |Expression|.
1. ReturnIfAbrupt(_sub_).
1. Let _subRef_ be the result of evaluating |Expression|.
1. ReturnIfAbrupt(_subRef_).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also here

spec.html Outdated
1. Let _sub_ be the result of evaluating |Expression|.
1. ReturnIfAbrupt(_sub_).
1. Let _subRef_ be the result of evaluating |Expression|.
1. ReturnIfAbrupt(_subRef_).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and here

@TimothyGu
Copy link
Member Author

@ljharb Fixed.

@ljharb ljharb assigned ljharb and unassigned bterlson and bmeck Sep 5, 2018
As currently spec'd, it is an undefined behavior when an Expression that
evaluates to a Reference is present in a TemplateLiteral, as the
Reference value would be directly passed into ToString which expects an
ECMAScript language value.

Fixes tc39#935.
@ljharb ljharb merged commit 44e8058 into tc39:master Sep 6, 2018
@TimothyGu TimothyGu deleted the templateliteral-getvalue branch September 6, 2018 01:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
normative change Affects behavior required to correctly evaluate some ECMAScript source text spec bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants