Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4f15bfcf1d | ||
|
|
a405d6d3d5 | ||
|
|
9c784436f0 |
@@ -56,7 +56,14 @@ exports.CallExpression = function (node, parent, file) {
|
||||
|
||||
if (callee.type === "MemberExpression") {
|
||||
contextLiteral = callee.object;
|
||||
callee.property = b.memberExpression(callee.property, b.identifier("apply"), false);
|
||||
|
||||
if (callee.computed) {
|
||||
callee.object = b.memberExpression(callee.object, callee.property, true);
|
||||
callee.property = b.identifier("apply");
|
||||
callee.computed = false;
|
||||
} else {
|
||||
callee.property = b.memberExpression(callee.property, b.identifier("apply"), false);
|
||||
}
|
||||
} else {
|
||||
node.callee = b.memberExpression(node.callee, b.identifier("apply"), false);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "6to5",
|
||||
"description": "Turn ES6 code into readable vanilla ES5 with source maps",
|
||||
"version": "1.9.8",
|
||||
"version": "1.9.9",
|
||||
"author": "Sebastian McKenzie <sebmck@gmail.com>",
|
||||
"homepage": "https://github.com/sebmck/6to5",
|
||||
"repository": {
|
||||
|
||||
1
test/fixtures/syntax/spread/contexted-computed-method-call-multiple-args/actual.js
vendored
Normal file
1
test/fixtures/syntax/spread/contexted-computed-method-call-multiple-args/actual.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
obj[method](foo, bar, ...args);
|
||||
3
test/fixtures/syntax/spread/contexted-computed-method-call-multiple-args/expected.js
vendored
Normal file
3
test/fixtures/syntax/spread/contexted-computed-method-call-multiple-args/expected.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
"use strict";
|
||||
var _slice = Array.prototype.slice;
|
||||
obj[method].apply(obj, [foo, bar].concat(_slice.call(args)));
|
||||
1
test/fixtures/syntax/spread/contexted-computed-method-call-single-arg/actual.js
vendored
Normal file
1
test/fixtures/syntax/spread/contexted-computed-method-call-single-arg/actual.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
obj[method](...args);
|
||||
3
test/fixtures/syntax/spread/contexted-computed-method-call-single-arg/expected.js
vendored
Normal file
3
test/fixtures/syntax/spread/contexted-computed-method-call-single-arg/expected.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
"use strict";
|
||||
var _slice = Array.prototype.slice;
|
||||
obj[method].apply(obj, _slice.call(args));
|
||||
Reference in New Issue
Block a user