toshok / echojs

an ahead of time compiler and runtime for ES6

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sparse Array objects impl

carlosalberto opened this issue · comments

It looks like SpiderMonkey, in the case of sparse arrays, fallbacks to simple property access* (i.e. arr[450] gets the '450' property, if any).

Wouldn't that work here for now, instead of creating a huge array? (for arrays > SOME_HUGE_VALUE, that is).

  • It looks like SP uses some checks here and there to detect this case, based on the use-case.