| 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 "src/ast.h" | 8 #include "src/ast.h" |
| 9 #include "src/pending-compilation-error-handler.h" | 9 #include "src/pending-compilation-error-handler.h" |
| 10 #include "src/zone.h" | 10 #include "src/zone.h" |
| (...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 482 | 482 |
| 483 // Find the script scope. | 483 // Find the script scope. |
| 484 // Used in modules implemenetation to find hosting scope. | 484 // Used in modules implemenetation to find hosting scope. |
| 485 // TODO(rossberg): is this needed? | 485 // TODO(rossberg): is this needed? |
| 486 Scope* ScriptScope(); | 486 Scope* ScriptScope(); |
| 487 | 487 |
| 488 // Find the first function, global, or eval scope. This is the scope | 488 // Find the first function, global, or eval scope. This is the scope |
| 489 // where var declarations will be hoisted to in the implementation. | 489 // where var declarations will be hoisted to in the implementation. |
| 490 Scope* DeclarationScope(); | 490 Scope* DeclarationScope(); |
| 491 | 491 |
| 492 // Find the first non-block declaration scope. This should be either a global, |
| 493 // eval or function top scope. Same as DeclarationScope(), but skips |
| 494 // declaration "block" scopes. Used for declaring temporaries. |
| 495 Scope* TempScope(); |
| 496 |
| 492 Handle<ScopeInfo> GetScopeInfo(Isolate* isolate); | 497 Handle<ScopeInfo> GetScopeInfo(Isolate* isolate); |
| 493 | 498 |
| 494 // Get the chain of nested scopes within this scope for the source statement | 499 // Get the chain of nested scopes within this scope for the source statement |
| 495 // position. The scopes will be added to the list from the outermost scope to | 500 // position. The scopes will be added to the list from the outermost scope to |
| 496 // the innermost scope. Only nested block, catch or with scopes are tracked | 501 // the innermost scope. Only nested block, catch or with scopes are tracked |
| 497 // and will be returned, but no inner function scopes. | 502 // and will be returned, but no inner function scopes. |
| 498 void GetNestedScopeChain(Isolate* isolate, List<Handle<ScopeInfo> >* chain, | 503 void GetNestedScopeChain(Isolate* isolate, List<Handle<ScopeInfo> >* chain, |
| 499 int statement_position); | 504 int statement_position); |
| 500 | 505 |
| 501 // --------------------------------------------------------------------------- | 506 // --------------------------------------------------------------------------- |
| (...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 763 PendingCompilationErrorHandler pending_error_handler_; | 768 PendingCompilationErrorHandler pending_error_handler_; |
| 764 | 769 |
| 765 // For tracking which classes are declared consecutively. Needed for strong | 770 // For tracking which classes are declared consecutively. Needed for strong |
| 766 // mode. | 771 // mode. |
| 767 int class_declaration_group_start_; | 772 int class_declaration_group_start_; |
| 768 }; | 773 }; |
| 769 | 774 |
| 770 } } // namespace v8::internal | 775 } } // namespace v8::internal |
| 771 | 776 |
| 772 #endif // V8_SCOPES_H_ | 777 #endif // V8_SCOPES_H_ |
| OLD | NEW |