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

Side by Side Diff: src/scopes.h

Issue 1423613002: Fix eval calls in initializers of arrow function parameters (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add comment, rebase Created 5 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « src/preparser.h ('k') | src/scopes.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_SCOPES_H_ 5 #ifndef V8_SCOPES_H_
6 #define V8_SCOPES_H_ 6 #define V8_SCOPES_H_
7 7
8 #include "src/ast.h" 8 #include "src/ast.h"
9 #include "src/pending-compilation-error-handler.h" 9 #include "src/pending-compilation-error-handler.h"
10 #include "src/zone.h" 10 #include "src/zone.h"
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 // Checks if the block scope is redundant, i.e. it does not contain any 110 // Checks if the block scope is redundant, i.e. it does not contain any
111 // block scoped declarations. In that case it is removed from the scope 111 // block scoped declarations. In that case it is removed from the scope
112 // tree and its children are reparented. 112 // tree and its children are reparented.
113 Scope* FinalizeBlockScope(); 113 Scope* FinalizeBlockScope();
114 114
115 // Inserts outer_scope into this scope's scope chain (and removes this 115 // Inserts outer_scope into this scope's scope chain (and removes this
116 // from the current outer_scope_'s inner_scopes_). 116 // from the current outer_scope_'s inner_scopes_).
117 // Assumes outer_scope_ is non-null. 117 // Assumes outer_scope_ is non-null.
118 void ReplaceOuterScope(Scope* outer_scope); 118 void ReplaceOuterScope(Scope* outer_scope);
119 119
120 // Propagates any eagerly-gathered scope usage flags (such as calls_eval())
121 // to the passed-in scope.
122 void PropagateUsageFlagsToScope(Scope* other);
123
120 Zone* zone() const { return zone_; } 124 Zone* zone() const { return zone_; }
121 125
122 // --------------------------------------------------------------------------- 126 // ---------------------------------------------------------------------------
123 // Declarations 127 // Declarations
124 128
125 // Lookup a variable in this scope. Returns the variable or NULL if not found. 129 // Lookup a variable in this scope. Returns the variable or NULL if not found.
126 Variable* LookupLocal(const AstRawString* name); 130 Variable* LookupLocal(const AstRawString* name);
127 131
128 // This lookup corresponds to a lookup in the "intermediate" scope sitting 132 // This lookup corresponds to a lookup in the "intermediate" scope sitting
129 // between this scope and the outer scope. (ECMA-262, 3rd., requires that 133 // between this scope and the outer scope. (ECMA-262, 3rd., requires that
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 // scope over a let binding of the same name. 234 // scope over a let binding of the same name.
231 Declaration* CheckConflictingVarDeclarations(); 235 Declaration* CheckConflictingVarDeclarations();
232 236
233 // --------------------------------------------------------------------------- 237 // ---------------------------------------------------------------------------
234 // Scope-specific info. 238 // Scope-specific info.
235 239
236 // Inform the scope that the corresponding code contains a with statement. 240 // Inform the scope that the corresponding code contains a with statement.
237 void RecordWithStatement() { scope_contains_with_ = true; } 241 void RecordWithStatement() { scope_contains_with_ = true; }
238 242
239 // Inform the scope that the corresponding code contains an eval call. 243 // Inform the scope that the corresponding code contains an eval call.
240 void RecordEvalCall() { if (!is_script_scope()) scope_calls_eval_ = true; } 244 void RecordEvalCall() { scope_calls_eval_ = true; }
241 245
242 // Inform the scope that the corresponding code uses "arguments". 246 // Inform the scope that the corresponding code uses "arguments".
243 void RecordArgumentsUsage() { scope_uses_arguments_ = true; } 247 void RecordArgumentsUsage() { scope_uses_arguments_ = true; }
244 248
245 // Inform the scope that the corresponding code uses "super". 249 // Inform the scope that the corresponding code uses "super".
246 void RecordSuperPropertyUsage() { scope_uses_super_property_ = true; } 250 void RecordSuperPropertyUsage() { scope_uses_super_property_ = true; }
247 251
248 // Set the language mode flag (unless disabled by a global flag). 252 // Set the language mode flag (unless disabled by a global flag).
249 void SetLanguageMode(LanguageMode language_mode) { 253 void SetLanguageMode(LanguageMode language_mode) {
250 language_mode_ = language_mode; 254 language_mode_ = language_mode;
(...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after
838 842
839 // For tracking which classes are declared consecutively. Needed for strong 843 // For tracking which classes are declared consecutively. Needed for strong
840 // mode. 844 // mode.
841 int class_declaration_group_start_; 845 int class_declaration_group_start_;
842 }; 846 };
843 847
844 } // namespace internal 848 } // namespace internal
845 } // namespace v8 849 } // namespace v8
846 850
847 #endif // V8_SCOPES_H_ 851 #endif // V8_SCOPES_H_
OLDNEW
« no previous file with comments | « src/preparser.h ('k') | src/scopes.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698