| 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/hashmap.h" | 8 #include "src/base/hashmap.h" |
| 9 #include "src/globals.h" | 9 #include "src/globals.h" |
| 10 #include "src/objects.h" | 10 #include "src/objects.h" |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 | 165 |
| 166 void AddUnresolved(VariableProxy* proxy); | 166 void AddUnresolved(VariableProxy* proxy); |
| 167 | 167 |
| 168 // Remove a unresolved variable. During parsing, an unresolved variable | 168 // Remove a unresolved variable. During parsing, an unresolved variable |
| 169 // may have been added optimistically, but then only the variable name | 169 // may have been added optimistically, but then only the variable name |
| 170 // was used (typically for labels). If the variable was not declared, the | 170 // was used (typically for labels). If the variable was not declared, the |
| 171 // addition introduced a new unresolved variable which may end up being | 171 // addition introduced a new unresolved variable which may end up being |
| 172 // allocated globally as a "ghost" variable. RemoveUnresolved removes | 172 // allocated globally as a "ghost" variable. RemoveUnresolved removes |
| 173 // such a variable again if it was added; otherwise this is a no-op. | 173 // such a variable again if it was added; otherwise this is a no-op. |
| 174 bool RemoveUnresolved(VariableProxy* var); | 174 bool RemoveUnresolved(VariableProxy* var); |
| 175 bool RemoveUnresolved(const AstRawString* name); |
| 175 | 176 |
| 176 // Creates a new temporary variable in this scope's TemporaryScope. The | 177 // Creates a new temporary variable in this scope's TemporaryScope. The |
| 177 // name is only used for printing and cannot be used to find the variable. | 178 // name is only used for printing and cannot be used to find the variable. |
| 178 // In particular, the only way to get hold of the temporary is by keeping the | 179 // In particular, the only way to get hold of the temporary is by keeping the |
| 179 // Variable* around. The name should not clash with a legitimate variable | 180 // Variable* around. The name should not clash with a legitimate variable |
| 180 // names. | 181 // names. |
| 181 // TODO(verwaest): Move to DeclarationScope? | 182 // TODO(verwaest): Move to DeclarationScope? |
| 182 Variable* NewTemporary(const AstRawString* name); | 183 Variable* NewTemporary(const AstRawString* name); |
| 183 | 184 |
| 184 // --------------------------------------------------------------------------- | 185 // --------------------------------------------------------------------------- |
| (...skipping 698 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 883 void AllocateModuleVariables(); | 884 void AllocateModuleVariables(); |
| 884 | 885 |
| 885 private: | 886 private: |
| 886 ModuleDescriptor* module_descriptor_; | 887 ModuleDescriptor* module_descriptor_; |
| 887 }; | 888 }; |
| 888 | 889 |
| 889 } // namespace internal | 890 } // namespace internal |
| 890 } // namespace v8 | 891 } // namespace v8 |
| 891 | 892 |
| 892 #endif // V8_AST_SCOPES_H_ | 893 #endif // V8_AST_SCOPES_H_ |
| OLD | NEW |