| Index: src/scopes.h
|
| diff --git a/src/scopes.h b/src/scopes.h
|
| index 4990fab994574a9fb9fbb27814ba93faf3ad5c86..12b70668cf8b38d1f87241ddb091fc58053dbd19 100644
|
| --- a/src/scopes.h
|
| +++ b/src/scopes.h
|
| @@ -390,10 +390,25 @@ class Scope: public ZoneObject {
|
| }
|
|
|
| bool has_simple_parameters() const {
|
| - DCHECK(is_function_scope());
|
| return has_simple_parameters_;
|
| }
|
|
|
| + // TODO(caitp): manage this state in a better way. PreParser must be able to
|
| + // communicate that the scope is non-simple, without allocating any parameters
|
| + // as the Parser does. This is necessary to ensure that TC39's proposed early
|
| + // error can be reported consistently regardless of whether lazily parsed or
|
| + // not.
|
| + void SetHasNonSimpleParameters() {
|
| + DCHECK(is_function_scope());
|
| + has_simple_parameters_ = false;
|
| + }
|
| +
|
| + // Retrieve `IsSimpleParameterList` of current or outer function.
|
| + bool HasSimpleParameters() {
|
| + Scope* scope = ClosureScope();
|
| + return !scope->is_function_scope() || scope->has_simple_parameters();
|
| + }
|
| +
|
| // The local variable 'arguments' if we need to allocate it; NULL otherwise.
|
| Variable* arguments() const {
|
| DCHECK(!is_arrow_scope() || arguments_ == nullptr);
|
|
|