On Fri, Nov 21, 2014 at 11:55 PM, Jonas Sicking <[email protected]> wrote:

> Has TC39 discussed how to handle the fact that there are a couple of
> classes in the DOM, like DOMStringList, which we'd like to replace
> with normal JS Arrays. But these DOM classes have a .contains function
> which so far has meant that such a switch was not possible due to the
> arrays not having a .contains.
>

I don't know if that aspect has been discussed, though I suspect it might
not have been in any depth.


>
> I had hoped that once Arrays got a .contains function that we could
> make this switch.
>

Switching those classes to JS Arrays would only work if it were
web-compatible which, sadly, Array#contains doesn't seem to be.


>
> Does TC39 recommend that we stick with returning DOM objects here and
> not switch to Arrays? Or that we do something else?
>

I don't know :/. Perhaps Jason does?


>
> / Jonas
>
> On Fri, Nov 21, 2014 at 5:10 AM, Till Schneidereit
> <[email protected]> wrote:
> > Greetings!
> >
> > TC39 has decided to solve the web-compat issues with
> > Array.prototype.contains that forced us to back out the feature on
> October
> > 1st by renaming the method to "includes". This has now landed on Nightly.
> > However, it is Nightly-only for now, so don't use it in production code
> > that's intended to make the merge to Developer's Edition.
> >
> > In further news and for similar reasons, String.prototype.contains will
> be
> > renamed to "includes" as well. This is somewhat unfortunate as we've been
> > shipping String.prototype.contains since Firefox 18. To work around that,
> > it'll probably be necessary to keep contains as an alias for a while,
> > ideally with a warning logged to the console. The rename is tracked in
> bug
> > 1102219.
> >
> > thank you,
> > till
> > _______________________________________________
> > dev-platform mailing list
> > [email protected]
> > https://lists.mozilla.org/listinfo/dev-platform
>
_______________________________________________
dev-tech-js-engine-internals mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-js-engine-internals

Reply via email to