Function script::dom::bindings::import::module::jsapi::JS::SameValue

source ·
pub unsafe extern "C" fn SameValue(
    cx: *mut JSContext,
    v1: Handle<Value>,
    v2: Handle<Value>,
    same: *mut bool,
) -> bool
Expand description

Stores |SameValue(v1, v2)| to |*equal| – using the SameValue operation defined in ECMAScript, initially exposed to script as |Object.is|. SameValue behaves identically to strict equality, except that it equates two NaN values and does not equate differently-signed zeroes. It performs no conversions on |v1| or |v2| before comparing.

This operation can fail only if an internal error occurs (e.g. OOM while linearizing a string value).