| 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/ast/ast.h" | 8 #include "src/ast/ast.h" |
| 9 #include "src/base/hashmap.h" | 9 #include "src/base/hashmap.h" |
| 10 #include "src/globals.h" | 10 #include "src/globals.h" |
| (...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 515 // True if it doesn't need scope resolution (e.g., if the scope was | 515 // True if it doesn't need scope resolution (e.g., if the scope was |
| 516 // constructed based on a serialized scope info or a catch context). | 516 // constructed based on a serialized scope info or a catch context). |
| 517 bool already_resolved_ : 1; | 517 bool already_resolved_ : 1; |
| 518 bool already_resolved() { return already_resolved_; } | 518 bool already_resolved() { return already_resolved_; } |
| 519 | 519 |
| 520 // True if it holds 'var' declarations. | 520 // True if it holds 'var' declarations. |
| 521 bool is_declaration_scope_ : 1; | 521 bool is_declaration_scope_ : 1; |
| 522 | 522 |
| 523 // Create a non-local variable with a given name. | 523 // Create a non-local variable with a given name. |
| 524 // These variables are looked up dynamically at runtime. | 524 // These variables are looked up dynamically at runtime. |
| 525 Variable* NonLocal(const AstRawString* name, VariableMode mode, | 525 Variable* NonLocal(const AstRawString* name, VariableMode mode); |
| 526 Variable::Kind variable_kind); | |
| 527 | 526 |
| 528 // Variable resolution. | 527 // Variable resolution. |
| 529 // Possible results of a recursive variable lookup telling if and how a | 528 // Possible results of a recursive variable lookup telling if and how a |
| 530 // variable is bound. These are returned in the output parameter *binding_kind | 529 // variable is bound. These are returned in the output parameter *binding_kind |
| 531 // of the LookupRecursive function. | 530 // of the LookupRecursive function. |
| 532 enum BindingKind { | 531 enum BindingKind { |
| 533 // The variable reference could be statically resolved to a variable binding | 532 // The variable reference could be statically resolved to a variable binding |
| 534 // which is returned. There is no 'with' statement between the reference and | 533 // which is returned. There is no 'with' statement between the reference and |
| 535 // the binding and no scope between the reference scope (inclusive) and | 534 // the binding and no scope between the reference scope (inclusive) and |
| 536 // binding scope (exclusive) makes a sloppy 'eval' call. | 535 // binding scope (exclusive) makes a sloppy 'eval' call. |
| (...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 899 // Convenience variable; Subclass constructor only | 898 // Convenience variable; Subclass constructor only |
| 900 Variable* this_function_; | 899 Variable* this_function_; |
| 901 // Module descriptor; module scopes only. | 900 // Module descriptor; module scopes only. |
| 902 ModuleDescriptor* module_descriptor_; | 901 ModuleDescriptor* module_descriptor_; |
| 903 }; | 902 }; |
| 904 | 903 |
| 905 } // namespace internal | 904 } // namespace internal |
| 906 } // namespace v8 | 905 } // namespace v8 |
| 907 | 906 |
| 908 #endif // V8_AST_SCOPES_H_ | 907 #endif // V8_AST_SCOPES_H_ |
| OLD | NEW |