| 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 485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 496 } | 496 } |
| 497 | 497 |
| 498 bool IsDeclaredParameter(const AstRawString* name) { | 498 bool IsDeclaredParameter(const AstRawString* name) { |
| 499 // If IsSimpleParameterList is false, duplicate parameters are not allowed, | 499 // If IsSimpleParameterList is false, duplicate parameters are not allowed, |
| 500 // however `arguments` may be allowed if function is not strict code. Thus, | 500 // however `arguments` may be allowed if function is not strict code. Thus, |
| 501 // the assumptions explained above do not hold. | 501 // the assumptions explained above do not hold. |
| 502 return params_.Contains(variables_.Lookup(name)); | 502 return params_.Contains(variables_.Lookup(name)); |
| 503 } | 503 } |
| 504 | 504 |
| 505 // Error handling. | 505 // Error handling. |
| 506 void ReportMessage(int start_position, int end_position, const char* message, | 506 void ReportMessage(int start_position, int end_position, |
| 507 MessageTemplate::Template message, |
| 507 const AstRawString* arg); | 508 const AstRawString* arg); |
| 508 | 509 |
| 509 // --------------------------------------------------------------------------- | 510 // --------------------------------------------------------------------------- |
| 510 // Debugging. | 511 // Debugging. |
| 511 | 512 |
| 512 #ifdef DEBUG | 513 #ifdef DEBUG |
| 513 void Print(int n = 0); // n = indentation; n < 0 => don't print recursively | 514 void Print(int n = 0); // n = indentation; n < 0 => don't print recursively |
| 514 #endif | 515 #endif |
| 515 | 516 |
| 516 // --------------------------------------------------------------------------- | 517 // --------------------------------------------------------------------------- |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 745 PendingCompilationErrorHandler pending_error_handler_; | 746 PendingCompilationErrorHandler pending_error_handler_; |
| 746 | 747 |
| 747 // For tracking which classes are declared consecutively. Needed for strong | 748 // For tracking which classes are declared consecutively. Needed for strong |
| 748 // mode. | 749 // mode. |
| 749 int class_declaration_group_start_; | 750 int class_declaration_group_start_; |
| 750 }; | 751 }; |
| 751 | 752 |
| 752 } } // namespace v8::internal | 753 } } // namespace v8::internal |
| 753 | 754 |
| 754 #endif // V8_SCOPES_H_ | 755 #endif // V8_SCOPES_H_ |
| OLD | NEW |