support spread syntax (#4328)
This commit is contained in:
@@ -702,6 +702,8 @@ function OutputStream(options) {
|
||||
|| p instanceof AST_ObjectProperty
|
||||
// (1, {foo:2}).foo or (1, {foo:2})["foo"] ==> 2
|
||||
|| p instanceof AST_PropAccess && p.expression === this
|
||||
// ...(foo, bar, baz)
|
||||
|| p instanceof AST_Spread
|
||||
// !(foo, bar, baz)
|
||||
|| p instanceof AST_Unary
|
||||
// var a = (1, 2), b = a + a; ==> b == 4
|
||||
@@ -1231,6 +1233,10 @@ function OutputStream(options) {
|
||||
this.property.print(output);
|
||||
output.print("]");
|
||||
});
|
||||
DEFPRINT(AST_Spread, function(output) {
|
||||
output.print("...");
|
||||
this.expression.print(output);
|
||||
});
|
||||
DEFPRINT(AST_UnaryPrefix, function(output) {
|
||||
var op = this.operator;
|
||||
var exp = this.expression;
|
||||
|
||||
Reference in New Issue
Block a user