On Wed, May 13, 2015 at 3:52 PM, Martin Thomson <m...@mozilla.com> wrote:

> On Wed, May 13, 2015 at 3:46 PM, Ehsan Akhgari <ehsan.akhg...@gmail.com>
> wrote:
> > ise() was an alias to is() as of bug 949614.  I landed bug 1154275 on
> > inbound today which removes ise() and replaces its usages with is().
> Since
> > is() now does a === comparison by default, there should be no reason to
> use
> > ise().
>
> \o/
>
> Incidentally, are we prepared to have a discussion about the relative
> merits of == and ===?
>
> I see a lot of code that is open to type coercion bugs and I've been
> told that == is in the official style (though I note its absence from
>
> https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Coding_Style#JavaScript_practices
> just now).
>
> Apologies if I hijack your thread.  I do want to continue to strongly
> encourage wider use of code deletion as a means of making progress.
>

I consider use of == in JavaScript testing code to be a bug: the ==
operator is just too wonky.

I would steer people in the direction of Assert.jsm, specifically
Assert.deepEqual, which uses ObjectUtils.jsm goodness for type aware
comparisons so things like Date, RegExp, and Object comparisons have sane
behavior. (deepEqual falls back to === for non-special types.
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to