| Index: src/ast/ast.h
|
| diff --git a/src/ast/ast.h b/src/ast/ast.h
|
| index 0ae2b6fd34fe37c0982d3b032291b64232e114ee..e350a284cb090dbd8d4b4cf4d21deffc4911f794 100644
|
| --- a/src/ast/ast.h
|
| +++ b/src/ast/ast.h
|
| @@ -2511,8 +2511,13 @@ class Yield final : public Expression {
|
| public:
|
| DECLARE_NODE_TYPE(Yield)
|
|
|
| + enum OnException { kOnExceptionThrow, kOnExceptionRethrow };
|
| +
|
| Expression* generator_object() const { return generator_object_; }
|
| Expression* expression() const { return expression_; }
|
| + bool rethrow_on_exception() const {
|
| + return on_exception_ == kOnExceptionRethrow;
|
| + }
|
| int yield_id() const { return yield_id_; }
|
|
|
| void set_generator_object(Expression* e) { generator_object_ = e; }
|
| @@ -2521,15 +2526,17 @@ class Yield final : public Expression {
|
|
|
| protected:
|
| Yield(Zone* zone, Expression* generator_object, Expression* expression,
|
| - int pos)
|
| + int pos, OnException on_exception)
|
| : Expression(zone, pos),
|
| generator_object_(generator_object),
|
| expression_(expression),
|
| + on_exception_(on_exception),
|
| yield_id_(-1) {}
|
|
|
| private:
|
| Expression* generator_object_;
|
| Expression* expression_;
|
| + OnException on_exception_;
|
| int yield_id_;
|
| };
|
|
|
| @@ -3399,12 +3406,11 @@ class AstNodeFactory final BASE_EMBEDDED {
|
| return assign;
|
| }
|
|
|
| - Yield* NewYield(Expression *generator_object,
|
| - Expression* expression,
|
| - int pos) {
|
| + Yield* NewYield(Expression* generator_object, Expression* expression, int pos,
|
| + Yield::OnException on_exception) {
|
| if (!expression) expression = NewUndefinedLiteral(pos);
|
| return new (local_zone_)
|
| - Yield(local_zone_, generator_object, expression, pos);
|
| + Yield(local_zone_, generator_object, expression, pos, on_exception);
|
| }
|
|
|
| Throw* NewThrow(Expression* exception, int pos) {
|
|
|