Closed Bug 642274 Opened 10 years ago Closed 10 years ago
Provide a way to compare to jsvals with '=='
You can compare two jsvals strictly ('==='), but there is no API to do a simple equality comparison ('=='). This would be handy to have.
Assignee: general → cdleary
Forgot to hg add the tests.
Comment on attachment 520027 [details] [diff] [review] Loose equality API. > bool >+LooselyEqual(JSContext *cx, const Value &lval, const Value &rval, JSBool *result) This should probably start off with the XML equality check, h8. Arguably this should be always-inline for parity with current behavior, but if we can get away with not having to over-specify that, sounds good to me. Keep an eye on perf numbers when you land this. We have a somewhat strange way of phrasing the spec algorithm with respect to DefaultValue-ing and stuff. Make sure to add documentation for this to MDN -- looks like you can just copy the JS_StrictlyEqual page and make a couple tweaks.
Attachment #520027 - Flags: review?(jwalden+bmo) → review+
Status: NEW → ASSIGNED
http://hg.mozilla.org/tracemonkey/rev/cfe6c2e05c07 (backout due to test bustage)
When might this land again?
cdleary-bot mozilla-central merge info: http://hg.mozilla.org/mozilla-central/rev/d10c089a6888
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.