Last Comment Bug 678961 - The nested JS parser in GCLI does not handle nested { and }
: The nested JS parser in GCLI does not handle nested { and }
Status: RESOLVED FIXED
:
Product: Firefox
Classification: Client Software
Component: Developer Tools (show other bugs)
: unspecified
: All All
: -- normal (vote)
: ---
Assigned To: Joe Walker [:jwalker] (needinfo me or ping on irc)
:
:
Mentors:
Depends on:
Blocks: GCLI-JS
  Show dependency treegraph
 
Reported: 2011-08-15 04:11 PDT by Joe Walker [:jwalker] (needinfo me or ping on irc)
Modified: 2011-09-05 04:27 PDT (History)
0 users
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments

Description Joe Walker [:jwalker] (needinfo me or ping on irc) 2011-08-15 04:11:33 PDT
For example:

> echo { (function() { return 'foo'; })() }

Requisition._tokenize will fail due to the nested { and }.
Commonly we expect people to use the scratchpad for complex JS expressions, and to properly comprehend this issue isn't just as simple as counting the nesting levels (due to strings, regexes, comments and other dangers)

The full solution would involve uglify/narcussus or the embedded JS parser in FF.
Comment 1 Joe Walker [:jwalker] (needinfo me or ping on irc) 2011-08-15 05:24:55 PDT
We should consider at least detecting this problem and warning the user rather than acting bizarrely.
Comment 2 Joe Walker [:jwalker] (needinfo me or ping on irc) 2011-08-30 03:53:20 PDT
See also bug 683121

Note You need to log in before you can comment on or make changes to this bug.