Compare commits

...

3 Commits

Author SHA1 Message Date
Sebastian McKenzie
4f15bfcf1d v1.9.9 2014-10-19 11:29:39 +11:00
Sebastian McKenzie
a405d6d3d5 Merge pull request #83 from thejameskyle/context-computed-spread-fix
Fix for spread on computed context
2014-10-19 11:11:54 +11:00
James Kyle
9c784436f0 Fix for spread on computed context 2014-10-18 17:07:23 -07:00
6 changed files with 17 additions and 2 deletions

View File

@@ -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);
}

View File

@@ -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": {

View File

@@ -0,0 +1 @@
obj[method](foo, bar, ...args);

View File

@@ -0,0 +1,3 @@
"use strict";
var _slice = Array.prototype.slice;
obj[method].apply(obj, [foo, bar].concat(_slice.call(args)));

View File

@@ -0,0 +1 @@
obj[method](...args);

View File

@@ -0,0 +1,3 @@
"use strict";
var _slice = Array.prototype.slice;
obj[method].apply(obj, _slice.call(args));