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(

View File

@ -5,6 +5,7 @@ function isSorted(_ref) {
var x = _ref2[0];
var y = _ref2[1];
var wow = _ref2.slice(2);
if (!zs.length) return true;

View File

@ -1,4 +1,4 @@
"use strict";
new (babelHelpers.bind.apply(Numbers, babelHelpers.toConsumableArray(nums)))();
new (babelHelpers.bind.apply(Numbers, [1].concat(babelHelpers.toConsumableArray(nums))))();
new (babelHelpers.bind.apply(Numbers, [null].concat(babelHelpers.toConsumableArray(nums))))();
new (babelHelpers.bind.apply(Numbers, [null].concat([1], babelHelpers.toConsumableArray(nums))))();