| 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 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 ParserBase* parser_; | 303 ParserBase* parser_; |
| 304 Mode old_mode_; | 304 Mode old_mode_; |
| 305 }; | 305 }; |
| 306 | 306 |
| 307 Scope* NewScope(Scope* parent, ScopeType scope_type, | 307 Scope* NewScope(Scope* parent, ScopeType scope_type, |
| 308 FunctionKind kind = kNormalFunction) { | 308 FunctionKind kind = kNormalFunction) { |
| 309 DCHECK(ast_value_factory()); | 309 DCHECK(ast_value_factory()); |
| 310 DCHECK(scope_type != MODULE_SCOPE || allow_harmony_modules()); | 310 DCHECK(scope_type != MODULE_SCOPE || allow_harmony_modules()); |
| 311 DCHECK((scope_type == FUNCTION_SCOPE && IsValidFunctionKind(kind)) || | 311 DCHECK((scope_type == FUNCTION_SCOPE && IsValidFunctionKind(kind)) || |
| 312 kind == kNormalFunction); | 312 kind == kNormalFunction); |
| 313 Scope* result = new (zone()) | 313 Scope* result = |
| 314 Scope(isolate(), zone(), parent, scope_type, ast_value_factory()); | 314 new (zone()) Scope(zone(), parent, scope_type, ast_value_factory()); |
| 315 bool uninitialized_this = | 315 bool uninitialized_this = |
| 316 FLAG_experimental_classes && IsSubclassConstructor(kind); | 316 FLAG_experimental_classes && IsSubclassConstructor(kind); |
| 317 result->Initialize(uninitialized_this); | 317 result->Initialize(uninitialized_this); |
| 318 return result; | 318 return result; |
| 319 } | 319 } |
| 320 | 320 |
| 321 Isolate* isolate() const { return isolate_; } | 321 Isolate* isolate() const { return isolate_; } |
| 322 Scanner* scanner() const { return scanner_; } | 322 Scanner* scanner() const { return scanner_; } |
| 323 AstValueFactory* ast_value_factory() const { return ast_value_factory_; } | 323 AstValueFactory* ast_value_factory() const { return ast_value_factory_; } |
| 324 int position() { return scanner_->location().beg_pos; } | 324 int position() { return scanner_->location().beg_pos; } |
| (...skipping 2735 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3060 *ok = false; | 3060 *ok = false; |
| 3061 return; | 3061 return; |
| 3062 } | 3062 } |
| 3063 has_seen_constructor_ = true; | 3063 has_seen_constructor_ = true; |
| 3064 return; | 3064 return; |
| 3065 } | 3065 } |
| 3066 } | 3066 } |
| 3067 } } // v8::internal | 3067 } } // v8::internal |
| 3068 | 3068 |
| 3069 #endif // V8_PREPARSER_H | 3069 #endif // V8_PREPARSER_H |
| OLD | NEW |