Closed
Bug 1382209
Opened 7 years ago
Closed 7 years ago
Add new restrictions for "yield" and "await" as binding identifiers per ES2018
Categories
(Core :: JavaScript Engine, enhancement)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla57
Tracking | Status | |
---|---|---|
firefox57 | --- | fixed |
People
(Reporter: anba, Assigned: anba)
Details
Attachments
(2 files, 2 obsolete files)
7.60 KB,
patch
|
anba
:
review+
|
Details | Diff | Splinter Review |
5.13 KB,
patch
|
anba
:
review+
|
Details | Diff | Splinter Review |
From https://github.com/tc39/ecma262/commit/925cdc437e0878b36f7ceb7dbecd9036157a6337 "yield" and "await" are now always parsed as binding identifiers, but additional static semantics restrict "yield" to non-generator and "await" to non-async function contexts. Ecma262 PR: https://github.com/tc39/ecma262/pull/885 Test262 PR: https://github.com/tc39/test262/issues/1084
Assignee | ||
Comment 1•7 years ago
|
||
We no longer need to take the yield-handling into account when checking if the next token after |let| continues a let-declaration (resp. the await-is-keyword state for "await"). Waldo's test cases are superseded by https://github.com/tc39/test262/issues/1084, therefore we can remove them, too.
Assignee | ||
Comment 2•7 years ago
|
||
"yield" is forbidden as an identifier in module contexts, because modules are implicitly strict-mode code, and not because the Module (https://tc39.github.io/ecma262/#prod-Module) production has a [Yield] grammar parameter. So we actually should use YieldIsName instead of YieldIsKeyword for the various module related parser methods.
Assignee | ||
Updated•7 years ago
|
Attachment #8887922 -
Flags: review?(shu)
Assignee | ||
Updated•7 years ago
|
Attachment #8887924 -
Flags: review?(shu)
Comment 3•7 years ago
|
||
Comment on attachment 8887922 [details] [diff] [review] bug1382209-part1-yield-await-bindingident.patch Review of attachment 8887922 [details] [diff] [review]: ----------------------------------------------------------------- This spec change is awesome. ::: js/src/frontend/Parser.cpp @@ +7464,5 @@ > MOZ_ALWAYS_TRUE(tokenStream.peekToken(&verify)); > MOZ_ASSERT(next == verify); > #endif > > // Destructuring is (for once) the easy case. Without the gnarly yield/await semantics, the comment now reads odd. I'd replace with // Destructuring continues a let declaration.
Attachment #8887922 -
Flags: review?(shu) → review+
Updated•7 years ago
|
Attachment #8887924 -
Flags: review?(shu) → review+
Comment 4•7 years ago
|
||
Comment on attachment 8887924 [details] [diff] [review] bug1382209-part2-yield-handling-modules.patch Review of attachment 8887924 [details] [diff] [review]: ----------------------------------------------------------------- While you're here, could you update the comment above ParserBase::isValidStrictBinding?
Assignee | ||
Comment 5•7 years ago
|
||
Update part 1 per review comments, carrying r+.
Attachment #8887922 -
Attachment is obsolete: true
Attachment #8895344 -
Flags: review+
Assignee | ||
Comment 6•7 years ago
|
||
Update part 2 per review comments, carrying r+.
Attachment #8887924 -
Attachment is obsolete: true
Attachment #8895345 -
Flags: review+
Assignee | ||
Comment 7•7 years ago
|
||
Try: https://treeherder.mozilla.org/#/jobs?repo=try&revision=06f70a56db4dbb89f79f68615a7d8817c6357b4a
Keywords: checkin-needed
Pushed by ryanvm@gmail.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/bf1ddf4c1619 Part 1: Add new restrictions for "yield" and "await" as binding identifiers per ES2018 draft spec. r=shu https://hg.mozilla.org/integration/mozilla-inbound/rev/595d4c0210e2 Part 2: Use correct YieldHandling for module contexts. r=shu
Keywords: checkin-needed
Comment 9•7 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/bf1ddf4c1619 https://hg.mozilla.org/mozilla-central/rev/595d4c0210e2
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
status-firefox57:
--- → fixed
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla57
You need to log in
before you can comment on or make changes to this bug.
Description
•