Chromium Code Reviews| OLD | NEW |
|---|---|
| 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_AST_SCOPES_H_ | 5 #ifndef V8_AST_SCOPES_H_ |
| 6 #define V8_AST_SCOPES_H_ | 6 #define V8_AST_SCOPES_H_ |
| 7 | 7 |
| 8 #include "src/base/compiler-specific.h" | 8 #include "src/base/compiler-specific.h" |
| 9 #include "src/base/hashmap.h" | 9 #include "src/base/hashmap.h" |
| 10 #include "src/globals.h" | 10 #include "src/globals.h" |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 203 // addition introduced a new unresolved variable which may end up being | 203 // addition introduced a new unresolved variable which may end up being |
| 204 // allocated globally as a "ghost" variable. RemoveUnresolved removes | 204 // allocated globally as a "ghost" variable. RemoveUnresolved removes |
| 205 // such a variable again if it was added; otherwise this is a no-op. | 205 // such a variable again if it was added; otherwise this is a no-op. |
| 206 bool RemoveUnresolved(VariableProxy* var); | 206 bool RemoveUnresolved(VariableProxy* var); |
| 207 | 207 |
| 208 // Creates a new temporary variable in this scope's TemporaryScope. The | 208 // Creates a new temporary variable in this scope's TemporaryScope. The |
| 209 // name is only used for printing and cannot be used to find the variable. | 209 // name is only used for printing and cannot be used to find the variable. |
| 210 // In particular, the only way to get hold of the temporary is by keeping the | 210 // In particular, the only way to get hold of the temporary is by keeping the |
| 211 // Variable* around. The name should not clash with a legitimate variable | 211 // Variable* around. The name should not clash with a legitimate variable |
| 212 // names. | 212 // names. |
| 213 // Only pass kNotAssigned if you know what you are doing. | |
|
adamk
2017/02/15 19:03:59
Not sure this comment is helpful. If this is dange
| |
| 213 // TODO(verwaest): Move to DeclarationScope? | 214 // TODO(verwaest): Move to DeclarationScope? |
| 214 Variable* NewTemporary(const AstRawString* name); | 215 Variable* NewTemporary(const AstRawString* name, |
| 216 MaybeAssignedFlag maybe_assigned = kMaybeAssigned); | |
| 215 | 217 |
| 216 // --------------------------------------------------------------------------- | 218 // --------------------------------------------------------------------------- |
| 217 // Illegal redeclaration support. | 219 // Illegal redeclaration support. |
| 218 | 220 |
| 219 // Check if the scope has conflicting var | 221 // Check if the scope has conflicting var |
| 220 // declarations, i.e. a var declaration that has been hoisted from a nested | 222 // declarations, i.e. a var declaration that has been hoisted from a nested |
| 221 // scope over a let binding of the same name. | 223 // scope over a let binding of the same name. |
| 222 Declaration* CheckConflictingVarDeclarations(); | 224 Declaration* CheckConflictingVarDeclarations(); |
| 223 | 225 |
| 224 // Check if the scope has a conflicting lexical declaration that has a name in | 226 // Check if the scope has a conflicting lexical declaration that has a name in |
| (...skipping 736 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 961 void AllocateModuleVariables(); | 963 void AllocateModuleVariables(); |
| 962 | 964 |
| 963 private: | 965 private: |
| 964 ModuleDescriptor* module_descriptor_; | 966 ModuleDescriptor* module_descriptor_; |
| 965 }; | 967 }; |
| 966 | 968 |
| 967 } // namespace internal | 969 } // namespace internal |
| 968 } // namespace v8 | 970 } // namespace v8 |
| 969 | 971 |
| 970 #endif // V8_AST_SCOPES_H_ | 972 #endif // V8_AST_SCOPES_H_ |
| OLD | NEW |