do_check_n/eq should perform strict equality check

RESOLVED WONTFIX

Status

RESOLVED WONTFIX
7 years ago
4 years ago

People

(Reporter: mano, Unassigned)

Tracking

12 Branch
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

do_check_eq seems to perform regular equality check. I have a use case for strict equality check (for now I'm just using do_check_true), and I think that switching all tests to work this way is better in general.

Comment 1

7 years ago
Actually, if we're going to change this (and I'd love to see this changed), we should change to "sameness", not strict equality.  Sameness would treat NaN as identical to NaN, -0 as identical to -0 but not to +0, and +0 as identical to +0 but not -0.  The SameValue definition in js/src/tests/shell.js implements this:

http://hg.mozilla.org/mozilla-central/annotate/a447e66c3174/js/src/tests/shell.js#l266
Works for me.

I'll try to patch it on try sometime this week and see how much it burns.
do_check_n/eq are now deprecated in favor of (not)equal, and (not)deepEqual, which are what I asked for here (albeit they do much more than a simple === check). It's somewhat unfortunate that the deep checks are opt-in, but that's not going to change.
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → WONTFIX
Oh, and there are also (not)strictEqual, which do simple ===/!== checks.
You need to log in before you can comment on or make changes to this bug.