Bug 1185106 - Part 9.1: Support async function statement in export default in Parser. r=efaust,till

MozReview-Commit-ID: 5oe1f3MRssu
This commit is contained in:
Tooru Fujisawa 2016-08-28 23:58:29 +09:00
parent c5236c1dc9
commit 769d4cad22

View File

@ -5047,6 +5047,20 @@ Parser<FullParseHandler>::exportDeclaration()
return null();
break;
default: {
if (tt == TOK_NAME && tokenStream.currentName() == context->names().async) {
TokenKind nextSameLine = TOK_EOF;
if (!tokenStream.peekTokenSameLine(&nextSameLine))
return null();
if (nextSameLine == TOK_FUNCTION) {
tokenStream.consumeKnownToken(nextSameLine);
kid = functionStmt(YieldIsName, AllowDefaultName, AsyncFunction);
if (!kid)
return null();
break;
}
}
tokenStream.ungetToken();
RootedPropertyName name(context, context->names().starDefaultStar);
nameNode = newName(name);