Re: Elements (extends Array)

On 8/8/13 1:52 AM, Jonas Sicking wrote:
> Couldn't we still implement such a method by having specially generated
> code which did type testing specifically by doing checks similar to what
> Array.isArray does? I.e. we would generate wholly different type testing
> code than we do for (other) DOM objects.

It depends on whether we even have a way to tell some Arrays apart from 
others internally.  Right now, SpiderMonkey (for example) doesn't allow 
an embedding to do that.

If we posit that that's changed, introducing basically a separate kind 
of DOM object that doesn't behave like all the others is possible, but 
would slow down some things (more branching) and would require a bunch 
more work to make it play nice with the JIT (because it doesn't have the 
same internal layout as other objects the JIT knows about).

So as I said, doable at significant performance cost.

-Boris

Received on Thursday, 8 August 2013 05:56:22 UTC