| 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_PREPARSER_H | 5 #ifndef V8_PREPARSER_H |
| 6 #define V8_PREPARSER_H | 6 #define V8_PREPARSER_H |
| 7 | 7 |
| 8 #include "src/v8.h" | 8 #include "src/v8.h" |
| 9 | 9 |
| 10 #include "src/bailout-reason.h" | 10 #include "src/bailout-reason.h" |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 310 ParserBase* parser_; | 310 ParserBase* parser_; |
| 311 Mode old_mode_; | 311 Mode old_mode_; |
| 312 }; | 312 }; |
| 313 | 313 |
| 314 Scope* NewScope(Scope* parent, ScopeType scope_type, | 314 Scope* NewScope(Scope* parent, ScopeType scope_type, |
| 315 FunctionKind kind = kNormalFunction) { | 315 FunctionKind kind = kNormalFunction) { |
| 316 DCHECK(ast_value_factory()); | 316 DCHECK(ast_value_factory()); |
| 317 DCHECK(scope_type != MODULE_SCOPE || allow_harmony_modules()); | 317 DCHECK(scope_type != MODULE_SCOPE || allow_harmony_modules()); |
| 318 DCHECK((scope_type == FUNCTION_SCOPE && IsValidFunctionKind(kind)) || | 318 DCHECK((scope_type == FUNCTION_SCOPE && IsValidFunctionKind(kind)) || |
| 319 kind == kNormalFunction); | 319 kind == kNormalFunction); |
| 320 Scope* result = | 320 Scope* result = new (zone()) |
| 321 new (zone()) Scope(zone(), parent, scope_type, ast_value_factory()); | 321 Scope(zone(), parent, scope_type, ast_value_factory(), kind); |
| 322 bool uninitialized_this = IsSubclassConstructor(kind); | 322 result->Initialize(); |
| 323 result->Initialize(uninitialized_this); | |
| 324 return result; | 323 return result; |
| 325 } | 324 } |
| 326 | 325 |
| 327 Scanner* scanner() const { return scanner_; } | 326 Scanner* scanner() const { return scanner_; } |
| 328 AstValueFactory* ast_value_factory() const { return ast_value_factory_; } | 327 AstValueFactory* ast_value_factory() const { return ast_value_factory_; } |
| 329 int position() { return scanner_->location().beg_pos; } | 328 int position() { return scanner_->location().beg_pos; } |
| 330 int peek_position() { return scanner_->peek_location().beg_pos; } | 329 int peek_position() { return scanner_->peek_location().beg_pos; } |
| 331 bool stack_overflow() const { return stack_overflow_; } | 330 bool stack_overflow() const { return stack_overflow_; } |
| 332 void set_stack_overflow() { stack_overflow_ = true; } | 331 void set_stack_overflow() { stack_overflow_ = true; } |
| 333 Mode mode() const { return mode_; } | 332 Mode mode() const { return mode_; } |
| (...skipping 2781 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3115 *ok = false; | 3114 *ok = false; |
| 3116 return; | 3115 return; |
| 3117 } | 3116 } |
| 3118 has_seen_constructor_ = true; | 3117 has_seen_constructor_ = true; |
| 3119 return; | 3118 return; |
| 3120 } | 3119 } |
| 3121 } | 3120 } |
| 3122 } } // v8::internal | 3121 } } // v8::internal |
| 3123 | 3122 |
| 3124 #endif // V8_PREPARSER_H | 3123 #endif // V8_PREPARSER_H |
| OLD | NEW |