Compare commits

...

2 Commits

Author SHA1 Message Date
Sebastian McKenzie
6f8cbf0ad1 v1.10.8 2014-10-31 11:43:36 +11:00
Sebastian McKenzie
6696d5fcf4 fix rest parameters in arrow functions containing wrong arguments reference - fixes #11 2014-10-31 11:42:09 +11:00
5 changed files with 18 additions and 3 deletions

View File

@@ -35,6 +35,8 @@ var go = function (getBody, node, file) {
}
}
if (node._ignoreAliasFunctions) return;
var getId;
if (node.type === "Identifier" && node.name === "arguments") {

View File

@@ -11,9 +11,14 @@ exports.Function = function (node, parent, file) {
if (node.params.length) templateName += "-arg";
util.ensureBlock(node);
node.body.body.unshift(util.template(templateName, {
var template = util.template(templateName, {
SLICE_KEY: file.addDeclaration("slice"),
VARIABLE_NAME: rest,
SLICE_ARG: b.literal(node.params.length)
}));
});
template.declarations[0].init.arguments[0]._ignoreAliasFunctions = true;
node.body.body.unshift(template);
};

View File

@@ -1,7 +1,7 @@
{
"name": "6to5",
"description": "Turn ES6 code into readable vanilla ES5 with source maps",
"version": "1.10.7",
"version": "1.10.8",
"author": "Sebastian McKenzie <sebmck@gmail.com>",
"homepage": "https://github.com/sebmck/6to5",
"repository": {

View File

@@ -0,0 +1,3 @@
var concat = (...arrs) => {
};

View File

@@ -0,0 +1,5 @@
"use strict";
var _slice = Array.prototype.slice;
var concat = function () {
var arrs = _slice.call(arguments);
};