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_SCOPES_H_ | 5 #ifndef V8_SCOPES_H_ |
6 #define V8_SCOPES_H_ | 6 #define V8_SCOPES_H_ |
7 | 7 |
8 #include "ast.h" | 8 #include "ast.h" |
9 #include "zone.h" | 9 #include "zone.h" |
10 | 10 |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 // block scoped declarations. In that case it is removed from the scope | 93 // block scoped declarations. In that case it is removed from the scope |
94 // tree and its children are reparented. | 94 // tree and its children are reparented. |
95 Scope* FinalizeBlockScope(); | 95 Scope* FinalizeBlockScope(); |
96 | 96 |
97 Zone* zone() const { return zone_; } | 97 Zone* zone() const { return zone_; } |
98 | 98 |
99 // --------------------------------------------------------------------------- | 99 // --------------------------------------------------------------------------- |
100 // Declarations | 100 // Declarations |
101 | 101 |
102 // Lookup a variable in this scope. Returns the variable or NULL if not found. | 102 // Lookup a variable in this scope. Returns the variable or NULL if not found. |
103 Variable* LocalLookup(Handle<String> name); | 103 Variable* LookupLocal(Handle<String> name); |
104 | 104 |
105 // This lookup corresponds to a lookup in the "intermediate" scope sitting | 105 // This lookup corresponds to a lookup in the "intermediate" scope sitting |
106 // between this scope and the outer scope. (ECMA-262, 3rd., requires that | 106 // between this scope and the outer scope. (ECMA-262, 3rd., requires that |
107 // the name of named function literal is kept in an intermediate scope | 107 // the name of named function literal is kept in an intermediate scope |
108 // in between this scope and the next outer scope.) | 108 // in between this scope and the next outer scope.) |
109 Variable* LookupFunctionVar(Handle<String> name, | 109 Variable* LookupFunctionVar(Handle<String> name, |
110 AstNodeFactory<AstNullVisitor>* factory); | 110 AstNodeFactory<AstNullVisitor>* factory); |
111 | 111 |
112 // Lookup a variable in this scope or outer scopes. | 112 // Lookup a variable in this scope or outer scopes. |
113 // Returns the variable or NULL if not found. | 113 // Returns the variable or NULL if not found. |
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
607 void SetDefaults(ScopeType type, | 607 void SetDefaults(ScopeType type, |
608 Scope* outer_scope, | 608 Scope* outer_scope, |
609 Handle<ScopeInfo> scope_info); | 609 Handle<ScopeInfo> scope_info); |
610 | 610 |
611 Zone* zone_; | 611 Zone* zone_; |
612 }; | 612 }; |
613 | 613 |
614 } } // namespace v8::internal | 614 } } // namespace v8::internal |
615 | 615 |
616 #endif // V8_SCOPES_H_ | 616 #endif // V8_SCOPES_H_ |
OLD | NEW |