| Index: src/ast.h
|
| diff --git a/src/ast.h b/src/ast.h
|
| index af6ecb8d10647d27faf9d01f5dc37928b30b77aa..66979eb0657a5fd2a4e2c89f76886bf4e984853a 100644
|
| --- a/src/ast.h
|
| +++ b/src/ast.h
|
| @@ -90,7 +90,8 @@ namespace internal {
|
| V(SuperPropertyReference) \
|
| V(SuperCallReference) \
|
| V(CaseClause) \
|
| - V(EmptyParentheses)
|
| + V(EmptyParentheses) \
|
| + V(DoExpression)
|
|
|
| #define AST_NODE_LIST(V) \
|
| DECLARATION_NODE_LIST(V) \
|
| @@ -490,6 +491,29 @@ class Block final : public BreakableStatement {
|
| };
|
|
|
|
|
| +class DoExpression final : public Expression {
|
| + public:
|
| + DECLARE_NODE_TYPE(DoExpression)
|
| +
|
| + Block* block() { return block_; }
|
| + VariableProxy* result() { return result_; }
|
| +
|
| + protected:
|
| + DoExpression(Zone* zone, Block* block, VariableProxy* result, int pos)
|
| + : Expression(zone, pos), block_(block), result_(result) {
|
| + DCHECK_NOT_NULL(block_);
|
| + DCHECK_NOT_NULL(result_);
|
| + }
|
| + static int parent_num_ids() { return Expression::num_ids(); }
|
| +
|
| + private:
|
| + int local_id(int n) const { return base_id() + parent_num_ids() + n; }
|
| +
|
| + Block* block_;
|
| + VariableProxy* result_;
|
| +};
|
| +
|
| +
|
| class Declaration : public AstNode {
|
| public:
|
| VariableProxy* proxy() const { return proxy_; }
|
| @@ -3558,6 +3582,11 @@ class AstNodeFactory final BASE_EMBEDDED {
|
| NativeFunctionLiteral(parser_zone_, name, extension, pos);
|
| }
|
|
|
| + DoExpression* NewDoExpression(Block* block, Variable* result_var, int pos) {
|
| + VariableProxy* result = NewVariableProxy(result_var, pos);
|
| + return new (parser_zone_) DoExpression(parser_zone_, block, result, pos);
|
| + }
|
| +
|
| ThisFunction* NewThisFunction(int pos) {
|
| return new (local_zone_) ThisFunction(local_zone_, pos);
|
| }
|
|
|