Bug 1499998 - Part 2: Disable generator and async support for BinAST. r=Yoric

This commit is contained in:
Tooru Fujisawa 2018-10-22 10:31:29 +09:00
parent d109e5ad21
commit d70b9121cc
2 changed files with 50 additions and 10 deletions

View File

@ -3235,9 +3235,13 @@ BinASTParser<Tok>::parseInterfaceEagerFunctionDeclaration(const size_t start, co
const auto syntax = FunctionSyntaxKind::Statement;
BINJS_MOZ_TRY_DECL(isAsync, tokenizer_->readBool());
if (isAsync) {
return raiseError("Async function is not supported in this preview release");
}
BINJS_MOZ_TRY_DECL(isGenerator, tokenizer_->readBool());
if (isGenerator) {
return raiseError("Generator is not supported in this preview release");
}
BINJS_MOZ_TRY_DECL(name, parseBindingIdentifier());
BINJS_MOZ_TRY_DECL(length, tokenizer_->readUnsignedLong());
@ -3287,9 +3291,13 @@ BinASTParser<Tok>::parseInterfaceEagerFunctionExpression(const size_t start, con
const auto syntax = FunctionSyntaxKind::Expression;
BINJS_MOZ_TRY_DECL(isAsync, tokenizer_->readBool());
if (isAsync) {
return raiseError("Async function is not supported in this preview release");
}
BINJS_MOZ_TRY_DECL(isGenerator, tokenizer_->readBool());
if (isGenerator) {
return raiseError("Generator is not supported in this preview release");
}
BINJS_MOZ_TRY_DECL(name, parseOptionalBindingIdentifier());
BINJS_MOZ_TRY_DECL(length, tokenizer_->readUnsignedLong());
@ -3389,9 +3397,13 @@ BinASTParser<Tok>::parseInterfaceEagerMethod(const size_t start, const BinKind k
const auto accessorType = AccessorType::None;
BINJS_MOZ_TRY_DECL(isAsync, tokenizer_->readBool());
if (isAsync) {
return raiseError("Async function is not supported in this preview release");
}
BINJS_MOZ_TRY_DECL(isGenerator, tokenizer_->readBool());
if (isGenerator) {
return raiseError("Generator is not supported in this preview release");
}
BINJS_MOZ_TRY_DECL(name, parsePropertyName());
BINJS_MOZ_TRY_DECL(length, tokenizer_->readUnsignedLong());
@ -4108,9 +4120,13 @@ BinASTParser<Tok>::parseInterfaceLazyFunctionDeclaration(const size_t start, con
const auto syntax = FunctionSyntaxKind::Statement;
BINJS_MOZ_TRY_DECL(isAsync, tokenizer_->readBool());
if (isAsync) {
return raiseError("Async function is not supported in this preview release");
}
BINJS_MOZ_TRY_DECL(isGenerator, tokenizer_->readBool());
if (isGenerator) {
return raiseError("Generator is not supported in this preview release");
}
BINJS_MOZ_TRY_DECL(name, parseBindingIdentifier());
BINJS_MOZ_TRY_DECL(length, tokenizer_->readUnsignedLong());
@ -4162,9 +4178,13 @@ BinASTParser<Tok>::parseInterfaceLazyFunctionExpression(const size_t start, cons
const auto syntax = FunctionSyntaxKind::Expression;
BINJS_MOZ_TRY_DECL(isAsync, tokenizer_->readBool());
if (isAsync) {
return raiseError("Async function is not supported in this preview release");
}
BINJS_MOZ_TRY_DECL(isGenerator, tokenizer_->readBool());
if (isGenerator) {
return raiseError("Generator is not supported in this preview release");
}
BINJS_MOZ_TRY_DECL(name, parseOptionalBindingIdentifier());
BINJS_MOZ_TRY_DECL(length, tokenizer_->readUnsignedLong());

View File

@ -711,6 +711,16 @@ EagerFunctionExpression:
init: |
const auto syntax = FunctionSyntaxKind::Expression;
fields:
isGenerator:
after: |
if (isGenerator) {
return raiseError("Generator is not supported in this preview release");
}
isAsync:
after: |
if (isAsync) {
return raiseError("Async function is not supported in this preview release");
}
contents:
before: |
BINJS_MOZ_TRY_DECL(funbox, buildFunctionBox(
@ -747,6 +757,16 @@ LazyFunctionExpression:
init: |
const auto syntax = FunctionSyntaxKind::Expression;
fields:
isGenerator:
after: |
if (isGenerator) {
return raiseError("Generator is not supported in this preview release");
}
isAsync:
after: |
if (isAsync) {
return raiseError("Async function is not supported in this preview release");
}
contents:
block:
replace: