On Thu, Jul 17, 2014 at 1:14 AM, Katelyn Gadd <[email protected]> wrote:
> What happens if you combine 'new Array(length)' + 'array[length - 1] =
> <default value>'? That seems like it would produce the optimal
> behavior in all cases.

Thanks for the suggestion! This does work for SpiderMonkey, at least
in some case, but it might not work as nicely for other JS engines
(including SpiderMonkey in the future! :)

Jan's suggested approach, which I've implemented in bug 1040593, seems
nicer and allows the |array[length - 1] = <default>| line to be
skipped.

Nick
_______________________________________________
dev-tech-js-engine-internals mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-js-engine-internals

Reply via email to