Bug 1352312 - Enable Async Iteration.

Tag #1287
This commit is contained in:
Gaming4JC 2019-12-14 10:42:18 -05:00 committed by Roy Tam
commit b476f2e713
2 changed files with 0 additions and 21 deletions

View file

@ -3785,12 +3785,6 @@ Parser<ParseHandler>::functionStmt(uint32_t toStringStart, YieldHandling yieldHa
GeneratorKind generatorKind = NotGenerator;
if (tt == TOK_MUL) {
#ifdef RELEASE_OR_BETA
if (asyncKind != SyncFunction) {
error(JSMSG_ASYNC_GENERATOR);
return null();
}
#endif
generatorKind = StarGenerator;
if (!tokenStream.getToken(&tt))
return null();
@ -3859,12 +3853,6 @@ Parser<ParseHandler>::functionExpr(uint32_t toStringStart, InvokedPrediction inv
return null();
if (tt == TOK_MUL) {
#ifdef RELEASE_OR_BETA
if (asyncKind != SyncFunction) {
error(JSMSG_ASYNC_GENERATOR);
return null();
}
#endif
generatorKind = StarGenerator;
if (!tokenStream.getToken(&tt))
return null();
@ -6156,7 +6144,6 @@ Parser<ParseHandler>::forStatement(YieldHandling yieldHandling)
}
}
#ifndef RELEASE_OR_BETA
if (pc->isAsync()) {
bool matched;
if (!tokenStream.matchToken(&matched, TOK_AWAIT))
@ -6167,7 +6154,6 @@ Parser<ParseHandler>::forStatement(YieldHandling yieldHandling)
iterKind = IteratorKind::Async;
}
}
#endif
MUST_MATCH_TOKEN(TOK_LP, JSMSG_PAREN_AFTER_FOR);
@ -9520,12 +9506,6 @@ Parser<ParseHandler>::propertyName(YieldHandling yieldHandling,
}
if (ltok == TOK_MUL) {
#ifdef RELEASE_OR_BETA
if (isAsync) {
error(JSMSG_ASYNC_GENERATOR);
return null();
}
#endif
isGenerator = true;
if (!tokenStream.getToken(&ltok))
return null();

View file

@ -185,7 +185,6 @@ MSG_DEF(JSMSG_ARRAY_COMP_LEFTSIDE, 0, JSEXN_SYNTAXERR, "invalid array compre
MSG_DEF(JSMSG_ARRAY_INIT_TOO_BIG, 0, JSEXN_INTERNALERR, "array initializer too large")
MSG_DEF(JSMSG_AS_AFTER_IMPORT_STAR, 0, JSEXN_SYNTAXERR, "missing keyword 'as' after import *")
MSG_DEF(JSMSG_AS_AFTER_RESERVED_WORD, 1, JSEXN_SYNTAXERR, "missing keyword 'as' after reserved word '{0}'")
MSG_DEF(JSMSG_ASYNC_GENERATOR, 0, JSEXN_SYNTAXERR, "generator function or method can't be async")
MSG_DEF(JSMSG_AWAIT_IN_DEFAULT, 0, JSEXN_SYNTAXERR, "await can't be used in default expression")
MSG_DEF(JSMSG_AWAIT_OUTSIDE_ASYNC, 0, JSEXN_SYNTAXERR, "await is only valid in async functions")
MSG_DEF(JSMSG_BAD_ARROW_ARGS, 0, JSEXN_SYNTAXERR, "invalid arrow-function arguments (parentheses around the arrow-function may help)")