Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(54)

Unified Diff: src/ast/scopes.h

Issue 2261693002: Dont track scope_inside_with_ explicitly (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Don't duplicate InsideWithScope walk in HasTrivialOuterContext Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/ast/scopes.cc » ('j') | src/ast/scopes.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « no previous file | src/ast/scopes.cc » ('j') | src/ast/scopes.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698