| 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 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 = |
| 321 new (zone()) Scope(zone(), parent, scope_type, ast_value_factory()); | 321 new (zone()) Scope(zone(), parent, scope_type, ast_value_factory()); |
| 322 bool uninitialized_this = | 322 bool uninitialized_this = IsSubclassConstructor(kind); |
| 323 FLAG_experimental_classes && IsSubclassConstructor(kind); | |
| 324 result->Initialize(uninitialized_this); | 323 result->Initialize(uninitialized_this); |
| 325 return result; | 324 return result; |
| 326 } | 325 } |
| 327 | 326 |
| 328 Scanner* scanner() const { return scanner_; } | 327 Scanner* scanner() const { return scanner_; } |
| 329 AstValueFactory* ast_value_factory() const { return ast_value_factory_; } | 328 AstValueFactory* ast_value_factory() const { return ast_value_factory_; } |
| 330 int position() { return scanner_->location().beg_pos; } | 329 int position() { return scanner_->location().beg_pos; } |
| 331 int peek_position() { return scanner_->peek_location().beg_pos; } | 330 int peek_position() { return scanner_->peek_location().beg_pos; } |
| 332 bool stack_overflow() const { return stack_overflow_; } | 331 bool stack_overflow() const { return stack_overflow_; } |
| 333 void set_stack_overflow() { stack_overflow_ = true; } | 332 void set_stack_overflow() { stack_overflow_ = true; } |
| (...skipping 2745 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3079 *ok = false; | 3078 *ok = false; |
| 3080 return; | 3079 return; |
| 3081 } | 3080 } |
| 3082 has_seen_constructor_ = true; | 3081 has_seen_constructor_ = true; |
| 3083 return; | 3082 return; |
| 3084 } | 3083 } |
| 3085 } | 3084 } |
| 3086 } } // v8::internal | 3085 } } // v8::internal |
| 3087 | 3086 |
| 3088 #endif // V8_PREPARSER_H | 3087 #endif // V8_PREPARSER_H |
| OLD | NEW |