Merge branch 'master' into code-generator
Conflicts: lib/6to5/transformers/rest-parameters.js
This commit is contained in:
@@ -35,6 +35,8 @@ var go = function (getBody, node, file) {
|
||||
}
|
||||
}
|
||||
|
||||
if (node._ignoreAliasFunctions) return;
|
||||
|
||||
var getId;
|
||||
|
||||
if (node.type === "Identifier" && node.name === "arguments") {
|
||||
|
||||
@@ -12,9 +12,14 @@ exports.Function = function (node, parent, file) {
|
||||
if (node.params.length) templateName += "-arg";
|
||||
|
||||
t.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);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user