fix spread binding with the wrong context

This commit is contained in:
Sebastian McKenzie
2015-03-28 05:37:38 +11:00
parent 9bc67c28e3
commit 07646475d9
3 changed files with 5 additions and 8 deletions

View File

@@ -107,13 +107,9 @@ export function NewExpression(node, parent, scope, file) {
var nodes = build(args, scope);
var first = nodes.shift();
var context = t.arrayExpression([t.literal(null)]);
if (nodes.length) {
args = t.callExpression(t.memberExpression(first, t.identifier("concat")), nodes);
} else {
args = first;
}
args = t.callExpression(t.memberExpression(context, t.identifier("concat")), nodes);
return t.newExpression(
t.callExpression(