add experimental es7 object spread/rest - closes #200

This commit is contained in:
Sebastian McKenzie
2014-11-23 21:43:01 +11:00
parent c500532469
commit 3447204d97
23 changed files with 155 additions and 24 deletions

View File

@@ -4,7 +4,8 @@ exports.Identifier = function (node) {
this.push(node.name);
};
exports.SpreadElement = function (node, print) {
exports.SpreadElement =
exports.SpreadProperty = function (node, print) {
this.push("...");
print(node.argument);
};

View File

@@ -9,6 +9,10 @@ exports.before = {
}
},
SpreadProperty: function (node, parent) {
return exports.before.nodes.Property(node, parent);
},
SwitchCase: function (node, parent) {
if (parent.cases[0] === node) {
return 1;