You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are limitations to the number of arguments that can be passed with Function.prototype.apply.
Some functions that use Function.prototype.apply only use it with the variable arguments in the first place. Those are limited by this anyway. There's nothing to do there, at least not without changing the API.
goog.array.concat
goog.array.splice
goog.array.join
goog.array.slice
goog.math.average
goog.math.standardDeviation
But some functions accept an array as a single argument and then pass that to Function.prototype.apply. It is reasonable, though somewhat uncommon, for there to be more than 65,537 elements in an array.
Function.prototype.apply was limiting the size of the subarray that could be
flattened. Related issue:
google#314
Signed off by: Yan Zhu, yzhu@yahoo-inc.com
It does seem like we could replace .apply(...) with direct function calls in many of the methods you point out. Feel free to send pull requests. Beyond that, was there a more general API change you had in mind?
There are limitations to the number of arguments that can be passed with
Function.prototype.apply
.Some functions that use
Function.prototype.apply
only use it with the variable arguments in the first place. Those are limited by this anyway. There's nothing to do there, at least not without changing the API.goog.array.concat
goog.array.splice
goog.array.join
goog.array.slice
goog.math.average
goog.math.standardDeviation
But some functions accept an array as a single argument and then pass that to
Function.prototype.apply
. It is reasonable, though somewhat uncommon, for there to be more than 65,537 elements in an array.goog.array.extend
goog.array.flatten
goog.array.insertArrayAt
goog.array.rotate
goog.math.Path.prototype.appendPath
goog.object.create
goog.string.format
goog.testing.PerformanceTimer.createResults
goog.testing.PerformanceTimer.prototype.finishTask_
The numbers seemed to vary (OS dependent?), but this is what I've measured:
JSFiddle
Other references to this problem:
goog.crypt.byteArrayToString
was mentioned in the discussion list and then fixed by da353e0.The text was updated successfully, but these errors were encountered: