JS StrictlyEqual

This article covers features introduced in SpiderMonkey 1.8.1

Determine whether two JavaScript values are equal in the sense of the === operator.


JSBool JS_StrictlyEqual(JSContext *cx, jsval v1, jsval v2, JSBool *equal);


JS_StrictlyEqual determines if v1 is strictly equal to v2 under the JavaScript === operator, as specified in ECMA 262-3 §11.9.6.  If the comparison attempt was successful, the method returns JS_TRUE  and stores the result in *equal; otherwise it returns JS_FALSE.

Comparing jsvals directly in C++, as in v1 == v2, does not produce a meaningful result, since it is possible for two distinct JSStrings or jsdoubles to represent the same string or number.

MXR ID Search for JS_StrictlyEqual

Document Tags and Contributors

Contributors to this page: Waldo, Jorend
Last updated by: Waldo,