mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-05 08:35:26 +00:00
Don't enforce [k,v] pattern restriction if destructuring for-each (346642).
This commit is contained in:
parent
f336401660
commit
19c7d67134
@ -2804,18 +2804,20 @@ Statement(JSContext *cx, JSTokenStream *ts, JSTreeContext *tc)
|
||||
if (TOKEN_TYPE_IS_DECL(tt)
|
||||
? (pn1->pn_count > 1 || pn1->pn_op == JSOP_DEFCONST
|
||||
#if JS_HAS_DESTRUCTURING
|
||||
|| pn1->pn_head->pn_type == TOK_RC
|
||||
|| (pn1->pn_head->pn_type == TOK_RB &&
|
||||
pn1->pn_head->pn_count != 2)
|
||||
|| (pn1->pn_head->pn_type == TOK_ASSIGN &&
|
||||
(pn1->pn_head->pn_left->pn_type != TOK_RB ||
|
||||
pn1->pn_head->pn_left->pn_count != 2))
|
||||
|| (pn->pn_op == JSOP_FORIN &&
|
||||
(pn1->pn_head->pn_type == TOK_RC ||
|
||||
(pn1->pn_head->pn_type == TOK_RB &&
|
||||
pn1->pn_head->pn_count != 2) ||
|
||||
(pn1->pn_head->pn_type == TOK_ASSIGN &&
|
||||
(pn1->pn_head->pn_left->pn_type != TOK_RB ||
|
||||
pn1->pn_head->pn_left->pn_count != 2))))
|
||||
#endif
|
||||
)
|
||||
: (pn1->pn_type != TOK_NAME &&
|
||||
pn1->pn_type != TOK_DOT &&
|
||||
#if JS_HAS_DESTRUCTURING
|
||||
(pn1->pn_type != TOK_RB || pn1->pn_count != 2) &&
|
||||
(pn->pn_op == JSOP_FORIN &&
|
||||
(pn1->pn_type != TOK_RB || pn1->pn_count != 2)) &&
|
||||
#endif
|
||||
#if JS_HAS_LVALUE_RETURN
|
||||
pn1->pn_type != TOK_LP &&
|
||||
|
Loading…
Reference in New Issue
Block a user