зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 7d9e3126b05b (bug 1066827)
This commit is contained in:
Родитель
aec0aba574
Коммит
2fd965d25b
|
@ -4461,15 +4461,10 @@ Parser<FullParseHandler>::forStatement()
|
|||
bool isForEach = false;
|
||||
unsigned iflags = 0;
|
||||
|
||||
if (allowsForEachIn()) {
|
||||
bool matched;
|
||||
if (!tokenStream.matchContextualKeyword(&matched, context->names().each))
|
||||
return null();
|
||||
if (matched) {
|
||||
iflags = JSITER_FOREACH;
|
||||
isForEach = true;
|
||||
sawDeprecatedForEach = true;
|
||||
}
|
||||
if (allowsForEachIn() && tokenStream.matchContextualKeyword(context->names().each)) {
|
||||
iflags = JSITER_FOREACH;
|
||||
isForEach = true;
|
||||
sawDeprecatedForEach = true;
|
||||
}
|
||||
|
||||
MUST_MATCH_TOKEN(TOK_LP, JSMSG_PAREN_AFTER_FOR);
|
||||
|
@ -6617,13 +6612,8 @@ Parser<FullParseHandler>::legacyComprehensionTail(ParseNode *bodyExpr, unsigned
|
|||
|
||||
pn2->setOp(JSOP_ITER);
|
||||
pn2->pn_iflags = JSITER_ENUMERATE;
|
||||
if (allowsForEachIn()) {
|
||||
bool matched;
|
||||
if (!tokenStream.matchContextualKeyword(&matched, context->names().each))
|
||||
return null();
|
||||
if (matched)
|
||||
pn2->pn_iflags |= JSITER_FOREACH;
|
||||
}
|
||||
if (allowsForEachIn() && tokenStream.matchContextualKeyword(context->names().each))
|
||||
pn2->pn_iflags |= JSITER_FOREACH;
|
||||
MUST_MATCH_TOKEN(TOK_LP, JSMSG_PAREN_AFTER_FOR);
|
||||
|
||||
uint32_t startYieldOffset = pc->lastYieldOffset;
|
||||
|
@ -7025,10 +7015,7 @@ Parser<ParseHandler>::comprehensionFor(GeneratorKind comprehensionKind)
|
|||
report(ParseError, false, null(), JSMSG_LET_COMP_BINDING);
|
||||
return null();
|
||||
}
|
||||
bool matched;
|
||||
if (!tokenStream.matchContextualKeyword(&matched, context->names().of))
|
||||
return null();
|
||||
if (!matched) {
|
||||
if (!tokenStream.matchContextualKeyword(context->names().of)) {
|
||||
report(ParseError, false, null(), JSMSG_OF_AFTER_FOR_NAME);
|
||||
return null();
|
||||
}
|
||||
|
|
|
@ -473,17 +473,16 @@ class MOZ_STACK_CLASS TokenStream
|
|||
MOZ_ALWAYS_TRUE(matched);
|
||||
}
|
||||
|
||||
bool matchContextualKeyword(bool *matchedp, Handle<PropertyName*> keyword) {
|
||||
bool matchContextualKeyword(Handle<PropertyName*> keyword) {
|
||||
TokenKind token;
|
||||
if (!getToken(&token))
|
||||
return false;
|
||||
if (token == TOK_NAME && currentToken().name() == keyword) {
|
||||
*matchedp = true;
|
||||
} else {
|
||||
*matchedp = false;
|
||||
if (!getToken(&token)) {
|
||||
ungetToken();
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
if (token == TOK_NAME && currentToken().name() == keyword)
|
||||
return true;
|
||||
ungetToken();
|
||||
return false;
|
||||
}
|
||||
|
||||
bool nextTokenEndsExpr() {
|
||||
|
|
Загрузка…
Ссылка в новой задаче