Bug 887549 - Don't handle destructuring shorthand in syntax parser, r=jandem.
authorBrian Hackett <bhackett1024@gmail.com>
Mon, 08 Jul 2013 07:08:15 -0600
changeset 137613 34adc60a3e6a483cb4c225d99e527abe31287268
parent 137612 d5663e2b65b4cbd675e013ac8098c3440c28a236
child 137614 94c61aeeebf9ecbe5d484bfcb98ada53db28ead3
push id30614
push userbhackett@mozilla.com
push dateMon, 08 Jul 2013 13:08:20 +0000
treeherdermozilla-inbound@34adc60a3e6a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjandem
bugs887549
milestone25.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 887549 - Don't handle destructuring shorthand in syntax parser, r=jandem.
js/src/frontend/Parser.cpp
--- a/js/src/frontend/Parser.cpp
+++ b/js/src/frontend/Parser.cpp
@@ -6619,16 +6619,18 @@ Parser<ParseHandler>::primaryExpr(TokenK
                     handler.setListFlag(pn, PNX_NONCONST);
             }
 #if JS_HAS_DESTRUCTURING_SHORTHAND
             else if (ltok == TOK_NAME && (tt == TOK_COMMA || tt == TOK_RC)) {
                 /*
                  * Support, e.g., |var {x, y} = o| as destructuring shorthand
                  * for |var {x: x, y: y} = o|, per proposed JS2/ES4 for JS1.8.
                  */
+                if (!abortIfSyntaxParser())
+                    return null();
                 tokenStream.ungetToken();
                 if (!tokenStream.checkForKeyword(atom->charsZ(), atom->length(), NULL, NULL))
                     return null();
                 handler.setListFlag(pn, PNX_DESTRUCT | PNX_NONCONST);
                 PropertyName *name = handler.isName(pn3);
                 JS_ASSERT(atom);
                 pn3 = newName(name);
                 if (!pn3)