ignore callee supers when doing spread compilation - fixes #2775

This commit is contained in:
Sebastian McKenzie
2015-11-12 01:59:07 -08:00
parent 69fb1854d7
commit f91cfa68b9
6 changed files with 130 additions and 2 deletions

View File

@@ -65,6 +65,9 @@ export default function ({ types: t }) {
let args = node.arguments;
if (!hasSpread(args)) return;
let calleePath = path.get("callee");
if (calleePath.isSuper()) return;
let contextLiteral = t.identifier("undefined");
node.arguments = [];
@@ -85,7 +88,7 @@ export default function ({ types: t }) {
let callee = node.callee;
if (path.get("callee").isMemberExpression()) {
if (calleePath.isMemberExpression()) {
let temp = scope.maybeGenerateMemoised(callee.object);
if (temp) {
callee.object = t.assignmentExpression("=", temp, callee.object);