Chromium Code Reviews| Index: src/ast/scopes.h |
| diff --git a/src/ast/scopes.h b/src/ast/scopes.h |
| index 41ccb92ffec17d1d67041daedaaedc9a29251209..6dfcff222145d699719ef7d7722fb11a68ea9d7e 100644 |
| --- a/src/ast/scopes.h |
| +++ b/src/ast/scopes.h |
| @@ -501,8 +501,6 @@ class Scope: public ZoneObject { |
| // The language mode of this scope. |
| STATIC_ASSERT(LANGUAGE_END == 2); |
| bool is_strict_ : 1; |
| - // This scope is inside a 'with' of some outer scope. |
| - bool scope_inside_with_ : 1; |
| // This scope or a nested catch scope or with scope contain an 'eval' call. At |
| // the 'eval' call site this scope is the declaration scope. |
| bool scope_calls_eval_ : 1; |
| @@ -595,6 +593,14 @@ class Scope: public ZoneObject { |
| ParseInfo* info = nullptr, |
| VariableProxy* stack = nullptr); |
| + bool InsideWithScope() const { |
| + for (const Scope* scope = this; scope != nullptr; |
| + scope = scope->outer_scope()) { |
| + if (scope->is_with_scope()) return true; |
| + } |
| + return false; |
| + } |
| + |
|
neis
2016/08/19 14:25:24
This will return true for any with scope. Is that
Toon Verwaest
2016/08/19 15:58:23
Yes? That's what the flag used to do
|
| // Scope analysis. |
| void PropagateScopeInfo(bool outer_scope_calls_sloppy_eval); |
| bool HasTrivialContext() const; |