better clarification of rest parameter size construction comment
This commit is contained in:
@@ -27,9 +27,11 @@ exports.Function = function (node, parent, file) {
|
||||
arrKey = t.binaryExpression("-", key, start);
|
||||
|
||||
// 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
|
||||
// going to store all the rest parameters
|
||||
//
|
||||
// we need to add a check to avoid constructing the array
|
||||
// with <1 if there are less arguments than params as it'll
|
||||
// cause an error
|
||||
arrLen = t.conditionalExpression(
|
||||
t.binaryExpression(">", len, start),
|
||||
t.binaryExpression("-", len, start),
|
||||
|
||||
Reference in New Issue
Block a user