add ambiguous rest parameters comment
This commit is contained in:
parent
e512264be7
commit
d7810cac08
@ -19,15 +19,17 @@ exports.Function = function (node, parent, file) {
|
||||
var len = file.generateUidIdentifier("len");
|
||||
|
||||
var arrKey = key;
|
||||
var arrLen = len;
|
||||
if (node.params.length) {
|
||||
// this method has additional params, so we need to subtract
|
||||
// the index of the current argument position from the
|
||||
// position in the array that we want to populate
|
||||
arrKey = t.binaryExpression("-", key, start);
|
||||
}
|
||||
|
||||
var arrLen = len;
|
||||
if (node.params.length) {
|
||||
// we need to work out the size of the array that we're
|
||||
// going to store all the rest parameters in, if there
|
||||
// are less arguments than params then the array can be
|
||||
// constructed with <1 which will cause an error
|
||||
arrLen = t.conditionalExpression(
|
||||
t.binaryExpression(">", len, start),
|
||||
t.binaryExpression("-", len, start),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user