зеркало из https://github.com/mozilla/gecko-dev.git
Don't enforce [k,v] pattern restriction if destructuring for-each (346642).
This commit is contained in:
Родитель
f336401660
Коммит
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 &&
|
||||
|| (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))
|
||||
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 &&
|
||||
|
|
Загрузка…
Ссылка в новой задаче