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)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla41
Tracking Status
firefox41 --- fixed

People

(Reporter: arai, Assigned: arai)

References

Details

Attachments

(1 file)

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: nobody → arai.unmht
Added MatchOrInsertSemicolon after assingExpr for `export default`.
Attachment #8613184 - Flags: review?(shu)
Thanks for fixing this arai.
Attachment #8613184 - Flags: review?(shu) → review+
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.

Attachment

General

Created:
Updated:
Size: