On Fri, Jun 6, 2014 at 1:11 PM, Boris Zbarsky <bzbar...@mit.edu> wrote:
> On 6/6/14, 3:19 PM, Ehsan Akhgari wrote:
>>
>> Can we make is() do those checks explicitly and if neither of these
>> cases apply, fall back to a non-strict equality check?
>
>
> Yes.  As in, we could make it special-case the number-to-string compare and
> use == for that, and use === for everything else.

I don't see why we would want to do that though. We should test that
we get the expected result, not approximately the expected result.
Something that passes our test might very well break a real-world web
page.

I.e. having a function that returns "0.4", but where the spec says to
return 0.4 should result in a test failure, since returning "0.4"
might very well break the web.

I definitely understand that it'll be a pain to convert existing tests
that rely on the relaxed matching. But rather than making the
implementation of is() be more complex and/or more relaxed, could we
instead convert those tests to either

is_relaxed(a, b)
or
ok(a == b)

/ Jonas
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to