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_H_ | 5 #ifndef V8_AST_H_ |
6 #define V8_AST_H_ | 6 #define V8_AST_H_ |
7 | 7 |
8 #include "src/v8.h" | 8 #include "src/v8.h" |
9 | 9 |
10 #include "src/assembler.h" | 10 #include "src/assembler.h" |
(...skipping 3357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3368 Assignment* assign = | 3368 Assignment* assign = |
3369 new(zone_) Assignment(zone_, op, target, value, pos); | 3369 new(zone_) Assignment(zone_, op, target, value, pos); |
3370 assign->Init(zone_, this); | 3370 assign->Init(zone_, this); |
3371 VISIT_AND_RETURN(Assignment, assign) | 3371 VISIT_AND_RETURN(Assignment, assign) |
3372 } | 3372 } |
3373 | 3373 |
3374 Yield* NewYield(Expression *generator_object, | 3374 Yield* NewYield(Expression *generator_object, |
3375 Expression* expression, | 3375 Expression* expression, |
3376 Yield::Kind yield_kind, | 3376 Yield::Kind yield_kind, |
3377 int pos) { | 3377 int pos) { |
| 3378 if (!expression) expression = NewUndefinedLiteral(pos); |
3378 Yield* yield = new(zone_) Yield( | 3379 Yield* yield = new(zone_) Yield( |
3379 zone_, generator_object, expression, yield_kind, pos); | 3380 zone_, generator_object, expression, yield_kind, pos); |
3380 VISIT_AND_RETURN(Yield, yield) | 3381 VISIT_AND_RETURN(Yield, yield) |
3381 } | 3382 } |
3382 | 3383 |
3383 Throw* NewThrow(Expression* exception, int pos) { | 3384 Throw* NewThrow(Expression* exception, int pos) { |
3384 Throw* t = new(zone_) Throw(zone_, exception, pos); | 3385 Throw* t = new(zone_) Throw(zone_, exception, pos); |
3385 VISIT_AND_RETURN(Throw, t) | 3386 VISIT_AND_RETURN(Throw, t) |
3386 } | 3387 } |
3387 | 3388 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3430 private: | 3431 private: |
3431 Zone* zone_; | 3432 Zone* zone_; |
3432 Visitor visitor_; | 3433 Visitor visitor_; |
3433 AstValueFactory* ast_value_factory_; | 3434 AstValueFactory* ast_value_factory_; |
3434 }; | 3435 }; |
3435 | 3436 |
3436 | 3437 |
3437 } } // namespace v8::internal | 3438 } } // namespace v8::internal |
3438 | 3439 |
3439 #endif // V8_AST_H_ | 3440 #endif // V8_AST_H_ |
OLD | NEW |