Chromium Code Reviews| Index: src/ast/scopes.h |
| diff --git a/src/ast/scopes.h b/src/ast/scopes.h |
| index 8c00927421fadb7ee9773ef559ebeb61f085901c..ab92d674da84d4ed9639d70f87adc1c3b81f9a7c 100644 |
| --- a/src/ast/scopes.h |
| +++ b/src/ast/scopes.h |
| @@ -530,63 +530,15 @@ class Scope: public ZoneObject { |
| Variable* NonLocal(const AstRawString* name, VariableMode mode); |
| // Variable resolution. |
| - // Possible results of a recursive variable lookup telling if and how a |
| - // variable is bound. These are returned in the output parameter *binding_kind |
| - // of the LookupRecursive function. |
| - enum BindingKind { |
| - // The variable reference could be statically resolved to a variable binding |
| - // which is returned. There is no 'with' statement between the reference and |
| - // the binding and no scope between the reference scope (inclusive) and |
| - // binding scope (exclusive) makes a sloppy 'eval' call. |
| - BOUND, |
| - |
| - // The variable reference could be statically resolved to a variable binding |
| - // which is returned. There is no 'with' statement between the reference and |
| - // the binding, but some scope between the reference scope (inclusive) and |
| - // binding scope (exclusive) makes a sloppy 'eval' call, that might |
| - // possibly introduce variable bindings shadowing the found one. Thus the |
| - // found variable binding is just a guess. |
| - BOUND_EVAL_SHADOWED, |
| - |
| - // The variable reference could not be statically resolved to any binding |
| - // and thus should be considered referencing a global variable. NULL is |
| - // returned. The variable reference is not inside any 'with' statement and |
| - // no scope between the reference scope (inclusive) and script scope |
| - // (exclusive) makes a sloppy 'eval' call. |
| - UNBOUND, |
| - |
| - // The variable reference could not be statically resolved to any binding |
| - // NULL is returned. The variable reference is not inside any 'with' |
| - // statement, but some scope between the reference scope (inclusive) and |
| - // script scope (exclusive) makes a sloppy 'eval' call, that might |
| - // possibly introduce a variable binding. Thus the reference should be |
| - // considered referencing a global variable unless it is shadowed by an |
| - // 'eval' introduced binding. |
| - UNBOUND_EVAL_SHADOWED, |
| - |
| - // The variable could not be statically resolved and needs to be looked up |
| - // dynamically. NULL is returned. There are two possible reasons: |
| - // * A 'with' statement has been encountered and there is no variable |
| - // binding for the name between the variable reference and the 'with'. |
| - // The variable potentially references a property of the 'with' object. |
| - // * The code is being executed as part of a call to 'eval' and the calling |
| - // context chain contains either a variable binding for the name or it |
| - // contains a 'with' context. |
| - DYNAMIC_LOOKUP |
| - }; |
| - |
| // Lookup a variable reference given by name recursively starting with this |
| // scope, and stopping when reaching the outer_scope_end scope. If the code is |
| // executed because of a call to 'eval', the context parameter should be set |
| // to the calling context of 'eval'. |
| - Variable* LookupRecursive(VariableProxy* proxy, BindingKind* binding_kind, |
| - AstNodeFactory* factory, |
| - Scope* outer_scope_end = nullptr); |
| - void ResolveTo(ParseInfo* info, BindingKind binding_kind, |
| - VariableProxy* proxy, Variable* var); |
| - void ResolveVariable(ParseInfo* info, VariableProxy* proxy, |
| - AstNodeFactory* factory); |
| - void ResolveVariablesRecursively(ParseInfo* info, AstNodeFactory* factory); |
| + Variable* LookupRecursive(VariableProxy* proxy, bool resolve_free, |
|
adamk
2016/08/23 18:15:10
Can you add a comment for the resolve_free argumen
|
| + Scope* outer_scope_end); |
| + void ResolveTo(ParseInfo* info, VariableProxy* proxy, Variable* var); |
| + void ResolveVariable(ParseInfo* info, VariableProxy* proxy); |
| + void ResolveVariablesRecursively(ParseInfo* info); |
| // Finds free variables of this scope. This mutates the unresolved variables |
| // list along the way, so full resolution cannot be done afterwards. |
| @@ -832,7 +784,7 @@ class DeclarationScope : public Scope { |
| // In the case of code compiled and run using 'eval', the context |
| // parameter is the context in which eval was called. In all other |
| // cases the context parameter is an empty handle. |
| - void AllocateVariables(ParseInfo* info, AstNodeFactory* factory); |
| + void AllocateVariables(ParseInfo* info); |
| // To be called during parsing. Do just enough scope analysis that we can |
| // discard the Scope for lazily compiled functions. In particular, this |