Chromium Code Reviews| Index: src/ast/scopes.h |
| diff --git a/src/ast/scopes.h b/src/ast/scopes.h |
| index ea37890c5e4875406996b0a5916141fc2459fc82..d5e9326f16a12750b8268752b882ec6e9f9c7f32 100644 |
| --- a/src/ast/scopes.h |
| +++ b/src/ast/scopes.h |
| @@ -680,6 +680,11 @@ class DeclarationScope : public Scope { |
| // calls sloppy eval. |
| Variable* DeclareFunctionVar(const AstRawString* name); |
| + // Declare some special internal variables which must be accessible to |
| + // Ignition without ScopeInfo. |
| + Variable* DeclareGeneratorObjectVar(const AstRawString* name); |
| + Variable* DeclarePromiseVar(const AstRawString* name); |
| + |
| // Declare a parameter in this scope. When there are duplicated |
| // parameters the rightmost one 'wins'. However, the implementation |
| // expects all parameters to be declared and from left to right. |
| @@ -718,6 +723,17 @@ class DeclarationScope : public Scope { |
| return function_; |
| } |
| + Variable* generator_object_var() const { |
| + DCHECK(is_function_scope() || is_module_scope()); |
| + return generator_object_; |
| + } |
| + |
| + Variable* promise_var() const { |
| + DCHECK(is_function_scope()); |
| + DCHECK(IsAsyncFunction(function_kind_)); |
| + return promise_; |
| + } |
| + |
| // Parameters. The left-most parameter has index 0. |
| // Only valid for function and module scopes. |
| Variable* parameter(int index) const { |
| @@ -874,6 +890,11 @@ class DeclarationScope : public Scope { |
| Variable* arguments_; |
| // Convenience variable; Subclass constructor only |
| Variable* this_function_; |
| + |
| + // Generator object, if any; generator function scopes and module scopes only. |
| + Variable* generator_object_; |
| + // Promise, if any; async function scopes only. |
| + Variable* promise_; |
|
Dan Ehrenberg
2017/02/08 21:12:56
Will there be more live DeclarationScopes than Fun
|
| }; |
| class ModuleScope final : public DeclarationScope { |