Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Unified Diff: src/ast.h

Issue 997823003: [es6] support rest parameters in arrow functions (alternative) (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/ast-numbering.cc » ('j') | src/preparser.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast.h
diff --git a/src/ast.h b/src/ast.h
index 8a13e21b1ef9929954f6a5301681bd5eaa21cbbc..3de1eeb266f9a62da0d49aa3a71daf4f1a257fe3 100644
--- a/src/ast.h
+++ b/src/ast.h
@@ -75,6 +75,7 @@ namespace internal {
V(FunctionLiteral) \
V(ClassLiteral) \
V(NativeFunctionLiteral) \
+ V(Spread) \
V(Conditional) \
V(VariableProxy) \
V(Literal) \
@@ -2224,6 +2225,27 @@ class CompareOperation FINAL : public Expression {
};
+class Spread FINAL : public Expression {
+ public:
+ DECLARE_NODE_TYPE(Spread)
+
+ Expression* expression() const { return expression_; }
+
+ static int num_ids() { return parent_num_ids(); }
+
+ protected:
+ Spread(Zone* zone, Expression* expression, int position)
+ : Expression(zone, position),
+ expression_(expression) {}
+ static int parent_num_ids() { return Expression::num_ids(); }
+
+ private:
+ int local_id(int n) const { return base_id() + parent_num_ids() + n; }
+
+ Expression* expression_;
+};
+
+
class Conditional FINAL : public Expression {
public:
DECLARE_NODE_TYPE(Conditional)
@@ -3432,6 +3454,10 @@ class AstNodeFactory FINAL BASE_EMBEDDED {
return new (zone_) CompareOperation(zone_, op, left, right, pos);
}
+ Spread* NewSpread(Expression* expression, int position) {
+ return new (zone_) Spread(zone_, expression, position);
+ }
+
Conditional* NewConditional(Expression* condition,
Expression* then_expression,
Expression* else_expression,
« no previous file with comments | « no previous file | src/ast-numbering.cc » ('j') | src/preparser.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698