Additional Math functions
fpizlo at apple.com
Wed Apr 29 16:11:01 UTC 2015
On Apr 29, 2015, at 9:04 AM, C. Scott Ananian <ecmascript at cscott.net <mailto:ecmascript at cscott.net>> wrote:
> Aren't there limits to the number of arguments you can pass to a ES function before getting a stack overflow?
Yup. For example WebKit limits to around 10000. This protects our other stack overflow detection logic from overflow.
> I've gotten in trouble trying to abuse the `arguments` array like this before, for example `Math.max.apply(Math, someVeryLargeArray)`.
> Empirically, with iojs 1.8.1:
> > Math.max.apply(Math, new Array(100000))
> > Math.max.apply(Math, new Array(1000000))
> RangeError: Maximum call stack size exceeded
That would be a great idea! Filed on our end: https://bugs.webkit.org/show_bug.cgi?id=144391 <https://bugs.webkit.org/show_bug.cgi?id=144391>
> If we're going to add math functions to the standard library, my vote would be for http://www.evanmiller.org/statistical-shortcomings-in-standard-math-libraries.html <http://www.evanmiller.org/statistical-shortcomings-in-standard-math-libraries.html>
> es-discuss mailing list
> es-discuss at mozilla.org <mailto:es-discuss at mozilla.org>
> https://mail.mozilla.org/listinfo/es-discuss <https://mail.mozilla.org/listinfo/es-discuss>
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the es-discuss