cmp over number and (string or bool or undefined)

This commit is contained in:
2008-08-12 01:05:33 -04:00
parent 24b94c6666
commit 0fa0454828
4 changed files with 59 additions and 13 deletions

View File

@@ -480,6 +480,14 @@ js_Object_p_propertyIsEnumerable(JSContext* cx, JSObject* obj, JSString *str)
return JSVAL_TO_BOOLEAN(v);
}
jsdouble FASTCALL
js_BooleanToNumber(JSContext* cx, jsint unboxed)
{
if (unboxed == JSVAL_TO_BOOLEAN(JSVAL_VOID))
return *cx->runtime->jsNaN;
return unboxed;
}
#define LO ARGSIZE_LO
#define F ARGSIZE_F
#define Q ARGSIZE_Q