| Index: src/scopes.h
|
| diff --git a/src/scopes.h b/src/scopes.h
|
| index 021b7b3b17820a8aae3da5aa20096c846d7f056d..f2ba050c7b997731a3d434d06a81fe0b38ffca8d 100644
|
| --- a/src/scopes.h
|
| +++ b/src/scopes.h
|
| @@ -403,6 +403,8 @@ class Scope: public ZoneObject {
|
| return has_simple_parameters_;
|
| }
|
|
|
| + bool has_parameter_expressions() const { return has_parameter_expressions_; }
|
| +
|
| // 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
|
| @@ -419,6 +421,16 @@ class Scope: public ZoneObject {
|
| return !scope->is_function_scope() || scope->has_simple_parameters();
|
| }
|
|
|
| + void SetHasParameterExpressions() {
|
| + DCHECK(is_function_scope());
|
| + has_parameter_expressions_ = true;
|
| + }
|
| +
|
| + bool HasParameterExpressions() {
|
| + Scope* scope = ClosureScope();
|
| + return !scope->is_function_scope() || scope->has_parameter_expressions();
|
| + }
|
| +
|
| // The local variable 'arguments' if we need to allocate it; NULL otherwise.
|
| Variable* arguments() const {
|
| DCHECK(!is_arrow_scope() || arguments_ == nullptr);
|
| @@ -661,6 +673,7 @@ class Scope: public ZoneObject {
|
| // Info about the parameter list of a function.
|
| int arity_;
|
| bool has_simple_parameters_;
|
| + bool has_parameter_expressions_;
|
| Variable* rest_parameter_;
|
| int rest_index_;
|
|
|
|
|