Closed
Bug 1101265
Opened 11 years ago
Closed 11 years ago
Infinite automatic semicolon insertion before invalid arrow function syntax.
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla37
People
(Reporter: arai, Assigned: arai)
References
Details
(Keywords: clownshoes, csectype-dos, regression)
Attachments
(1 file, 1 obsolete file)
|
4.08 KB,
patch
|
Waldo
:
review+
|
Details | Diff | Splinter Review |
Parser falls into infinite loop with following code:
1
)=>
Semicolon is inserted automatically and infinitely before TOK_RP,
because primaryExpr returns null literal for TOK_RP without consuming any token.
| Assignee | ||
Comment 1•11 years ago
|
||
TOK_RP in primaryExpr is allowed only if it's just after TOK_LP.
Attachment #8525036 -
Flags: review?(jwalden+bmo)
| Assignee | ||
Comment 2•11 years ago
|
||
This seems to be the regression by bug 846406.
Confirmed that this happens on Nightly 22.0a1(2013-03-20), with evaluating following code in console:
eval("1\n)=>")
and memory usage grows rapidly.
Updated•11 years ago
|
| Assignee | ||
Comment 3•11 years ago
|
||
Try run is green: https://treeherder.mozilla.org/ui/#/jobs?repo=try&revision=22bf87b96a28
Updated•11 years ago
|
Keywords: clownshoes
| Assignee | ||
Comment 4•11 years ago
|
||
Comment on attachment 8525036 [details] [diff] [review]
Parse empty arrow function parameter only in the right place.
clearing r? for now,
I'll post the fixed one after try run.
Attachment #8525036 -
Flags: review?(jwalden+bmo)
| Assignee | ||
Comment 5•11 years ago
|
||
Green on try run: https://treeherder.mozilla.org/ui/#/jobs?repo=try&revision=e7720384e27e
Attachment #8525036 -
Attachment is obsolete: true
Attachment #8535983 -
Flags: review?(jwalden+bmo)
Comment 6•11 years ago
|
||
Comment on attachment 8535983 [details] [diff] [review]
Simplify parsing empty arrow function parameter.
Review of attachment 8535983 [details] [diff] [review]:
-----------------------------------------------------------------
::: js/src/frontend/Parser.cpp
@@ +8110,5 @@
> + // with no params: `() => body`.
> + tokenStream.consumeKnownToken(next);
> +
> + if (!tokenStream.peekToken(&next))
> + return null();
I was going to say add a test for this to that big test with all the @ in it...but such a test already exists in that test. \o/
Attachment #8535983 -
Flags: review?(jwalden+bmo) → review+
| Assignee | ||
Comment 7•11 years ago
|
||
Comment 8•11 years ago
|
||
Assignee: nobody → arai_a
Status: NEW → RESOLVED
Closed: 11 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla37
You need to log in
before you can comment on or make changes to this bug.
Description
•