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 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
367 // temporaries. | 367 // temporaries. |
368 DeclarationScope* GetClosureScope(); | 368 DeclarationScope* GetClosureScope(); |
369 | 369 |
370 // Find the first (non-arrow) function or script scope. This is where | 370 // Find the first (non-arrow) function or script scope. This is where |
371 // 'this' is bound, and what determines the function kind. | 371 // 'this' is bound, and what determines the function kind. |
372 DeclarationScope* GetReceiverScope(); | 372 DeclarationScope* GetReceiverScope(); |
373 | 373 |
374 // Find the module scope, assuming there is one. | 374 // Find the module scope, assuming there is one. |
375 ModuleScope* GetModuleScope(); | 375 ModuleScope* GetModuleScope(); |
376 | 376 |
| 377 // Find the innermost outer scope that needs a context. |
| 378 Scope* GetOuterScopeWithContext(); |
| 379 |
377 // Analyze() must have been called once to create the ScopeInfo. | 380 // Analyze() must have been called once to create the ScopeInfo. |
378 Handle<ScopeInfo> scope_info() { | 381 Handle<ScopeInfo> scope_info() { |
379 DCHECK(!scope_info_.is_null()); | 382 DCHECK(!scope_info_.is_null()); |
380 return scope_info_; | 383 return scope_info_; |
381 } | 384 } |
382 | 385 |
383 // --------------------------------------------------------------------------- | 386 // --------------------------------------------------------------------------- |
384 // Strict mode support. | 387 // Strict mode support. |
385 bool IsDeclared(const AstRawString* name) { | 388 bool IsDeclared(const AstRawString* name) { |
386 // During formal parameter list parsing the scope only contains | 389 // During formal parameter list parsing the scope only contains |
(...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
873 void AllocateModuleVariables(); | 876 void AllocateModuleVariables(); |
874 | 877 |
875 private: | 878 private: |
876 ModuleDescriptor* module_descriptor_; | 879 ModuleDescriptor* module_descriptor_; |
877 }; | 880 }; |
878 | 881 |
879 } // namespace internal | 882 } // namespace internal |
880 } // namespace v8 | 883 } // namespace v8 |
881 | 884 |
882 #endif // V8_AST_SCOPES_H_ | 885 #endif // V8_AST_SCOPES_H_ |
OLD | NEW |