| 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/hashmap.h" | 9 #include "src/hashmap.h" |
| 10 #include "src/pending-compilation-error-handler.h" | 10 #include "src/pending-compilation-error-handler.h" |
| (...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 533 // function objects (i.e., the scope for which a function prologue allocates | 533 // function objects (i.e., the scope for which a function prologue allocates |
| 534 // a context) or declaring temporaries. | 534 // a context) or declaring temporaries. |
| 535 Scope* ClosureScope(); | 535 Scope* ClosureScope(); |
| 536 | 536 |
| 537 // Find the first (non-arrow) function or script scope. This is where | 537 // Find the first (non-arrow) function or script scope. This is where |
| 538 // 'this' is bound, and what determines the function kind. | 538 // 'this' is bound, and what determines the function kind. |
| 539 Scope* ReceiverScope(); | 539 Scope* ReceiverScope(); |
| 540 | 540 |
| 541 Handle<ScopeInfo> GetScopeInfo(Isolate* isolate); | 541 Handle<ScopeInfo> GetScopeInfo(Isolate* isolate); |
| 542 | 542 |
| 543 void CollectNonLocals(HashMap* non_locals); | 543 Handle<StringSet> CollectNonLocals(Handle<StringSet> non_locals); |
| 544 | 544 |
| 545 // --------------------------------------------------------------------------- | 545 // --------------------------------------------------------------------------- |
| 546 // Strict mode support. | 546 // Strict mode support. |
| 547 bool IsDeclared(const AstRawString* name) { | 547 bool IsDeclared(const AstRawString* name) { |
| 548 // During formal parameter list parsing the scope only contains | 548 // During formal parameter list parsing the scope only contains |
| 549 // two variables inserted at initialization: "this" and "arguments". | 549 // two variables inserted at initialization: "this" and "arguments". |
| 550 // "this" is an invalid parameter name and "arguments" is invalid parameter | 550 // "this" is an invalid parameter name and "arguments" is invalid parameter |
| 551 // name in strict mode. Therefore looking up with the map which includes | 551 // name in strict mode. Therefore looking up with the map which includes |
| 552 // "this" and "arguments" in addition to all formal parameters is safe. | 552 // "this" and "arguments" in addition to all formal parameters is safe. |
| 553 return variables_.Lookup(name) != NULL; | 553 return variables_.Lookup(name) != NULL; |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 801 AstValueFactory* ast_value_factory_; | 801 AstValueFactory* ast_value_factory_; |
| 802 Zone* zone_; | 802 Zone* zone_; |
| 803 | 803 |
| 804 PendingCompilationErrorHandler pending_error_handler_; | 804 PendingCompilationErrorHandler pending_error_handler_; |
| 805 }; | 805 }; |
| 806 | 806 |
| 807 } // namespace internal | 807 } // namespace internal |
| 808 } // namespace v8 | 808 } // namespace v8 |
| 809 | 809 |
| 810 #endif // V8_AST_SCOPES_H_ | 810 #endif // V8_AST_SCOPES_H_ |
| OLD | NEW |