Closed
Bug 1169853
Opened 11 years ago
Closed 11 years ago
export default AssignmentExpression without trailing semicolon wrongly passes parser.
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla41
| Tracking | Status | |
|---|---|---|
| firefox41 | --- | fixed |
People
(Reporter: arai, Assigned: arai)
References
Details
Attachments
(1 file)
|
1.84 KB,
patch
|
shu
:
review+
|
Details | Diff | Splinter Review |
Reflect.parse("export default a 1")
Returns valid Program, since semicolon after AssignmentExpression is not checked.
http://people.mozilla.org/~jorendorff/es6-draft.html#sec-exports
> ExportDeclaration :
> ...
> export default [lookahead ∉ {function, class}] AssignmentExpression[In] ;
https://dxr.mozilla.org/mozilla-central/source/js/src/frontend/Parser.cpp#4520
> default:
> tokenStream.ungetToken();
> kid = assignExpr(InAllowed, YieldIsKeyword);
> break;
MatchOrInsertSemicolon should be there.
| Assignee | ||
Comment 1•11 years ago
|
||
Assignee: nobody → arai.unmht
| Assignee | ||
Comment 2•11 years ago
|
||
Added MatchOrInsertSemicolon after assingExpr for `export default`.
Attachment #8613184 -
Flags: review?(shu)
Comment 3•11 years ago
|
||
Thanks for fixing this arai.
Updated•11 years ago
|
Attachment #8613184 -
Flags: review?(shu) → review+
Comment 5•11 years ago
|
||
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla41
You need to log in
before you can comment on or make changes to this bug.
Description
•