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

Unified Diff: src/ast/scopes.h

Issue 2229373002: Fix CollectNonLocals (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address offline comment 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') | no next file with comments »
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 3dee4c65f1aebf0e8a0ae82e9f3a78637aa2bcc5..d71f084ddc848571ebf964bd13e255e6b8ccc278 100644
--- a/src/ast/scopes.h
+++ b/src/ast/scopes.h
@@ -414,8 +414,6 @@ class Scope: public ZoneObject {
Handle<ScopeInfo> GetScopeInfo(Isolate* isolate);
- Handle<StringSet> CollectNonLocals(Handle<StringSet> non_locals);
-
// ---------------------------------------------------------------------------
// Strict mode support.
bool IsDeclared(const AstRawString* name) {
@@ -579,15 +577,18 @@ class Scope: public ZoneObject {
Variable* LookupRecursive(VariableProxy* proxy, BindingKind* binding_kind,
AstNodeFactory* factory,
Scope* max_outer_scope = 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);
- // Tries to resolve local variables inside max_outer_scope; migrates those
- // which cannot be resolved into migrate_to.
- void MigrateUnresolvableLocals(DeclarationScope* migrate_to,
- AstNodeFactory* ast_node_factory,
- DeclarationScope* max_outer_scope);
+ // Finds free variables of this scope. This mutates the unresolved variables
+ // list along the way, so full resolution cannot be done afterwards.
+ // If a ParseInfo* is passed, non-free variables will be resolved.
+ VariableProxy* FetchFreeVariables(DeclarationScope* max_outer_scope,
+ ParseInfo* info = nullptr,
+ VariableProxy* stack = nullptr);
// Scope analysis.
void PropagateScopeInfo(bool outer_scope_calls_sloppy_eval);
@@ -849,6 +850,9 @@ class DeclarationScope : public Scope {
void AnalyzePartially(DeclarationScope* migrate_to,
AstNodeFactory* ast_node_factory);
+ Handle<StringSet> CollectNonLocals(ParseInfo* info,
+ Handle<StringSet> non_locals);
+
#ifdef DEBUG
void PrintParameters();
#endif
« no previous file with comments | « no previous file | src/ast/scopes.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698