better clarification of rest parameter size construction comment

This commit is contained in:
Sebastian McKenzie
2015-01-17 10:23:53 +11:00
parent 76b8945207
commit dc6a862bec

View File

@@ -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),