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

Unified Diff: src/ast.h

Issue 987083003: [es6] support rest parameters in arrow functions (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix preparser bug 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/full-codegen.cc » ('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 847101480e0cc9b8e2ae1aec5a2cf6b16b17b679..b2bd2f8db4cf2f7aa2a56f60b6c5a413a54ec1cf 100644
--- a/src/ast.h
+++ b/src/ast.h
@@ -92,6 +92,7 @@ namespace internal {
V(CountOperation) \
V(BinaryOperation) \
V(CompareOperation) \
+ V(SpreadOperation) \
arv (Not doing code reviews) 2015/03/10 13:44:02 Maybe just Spread?
V(ThisFunction) \
V(SuperReference) \
V(CaseClause)
@@ -2224,6 +2225,24 @@ class CompareOperation FINAL : public Expression {
};
+class SpreadOperation FINAL : public Expression {
+ public:
+ DECLARE_NODE_TYPE(SpreadOperation)
+
+ Expression* expression() const { return expression_; }
+ static int num_ids() { return parent_num_ids() + 1; }
+
+ protected:
+ SpreadOperation(Zone* zone, Expression* expression, int pos)
+ : Expression(zone, pos), 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 +3451,10 @@ class AstNodeFactory FINAL BASE_EMBEDDED {
return new (zone_) CompareOperation(zone_, op, left, right, pos);
}
+ SpreadOperation* NewSpreadOperation(Expression* expression, int pos) {
+ return new (zone_) SpreadOperation(zone_, expression, pos);
+ }
+
Conditional* NewConditional(Expression* condition,
Expression* then_expression,
Expression* else_expression,
« no previous file with comments | « no previous file | src/ast-numbering.cc » ('j') | src/full-codegen.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698