--- sbbs/include/mozilla/js/jsnum.h 2018/04/24 16:41:23 1.1 +++ sbbs/include/mozilla/js/jsnum.h 2018/04/24 16:42:15 1.1.1.2 @@ -67,9 +67,9 @@ JS_BEGIN_EXTERN_C typedef union jsdpun { struct { #if defined(IS_LITTLE_ENDIAN) && !defined(CPU_IS_ARM) - uint32 lo, hi; + uint32 lo, hi; #else - uint32 hi, lo; + uint32 hi, lo; #endif } s; jsdouble d; @@ -124,7 +124,7 @@ typedef union jsdpun { ((JSDOUBLE_HI32(x) & JSDOUBLE_HI32_EXPMASK) != JSDOUBLE_HI32_EXPMASK) #define JSDOUBLE_IS_NEGZERO(d) (JSDOUBLE_HI32(d) == JSDOUBLE_HI32_SIGNBIT && \ - JSDOUBLE_LO32(d) == 0) + JSDOUBLE_LO32(d) == 0) /* * JSDOUBLE_IS_INT first checks that d is neither NaN nor infinite, to avoid @@ -134,7 +134,16 @@ typedef union jsdpun { */ #define JSDOUBLE_IS_INT(d, i) (JSDOUBLE_IS_FINITE(d) \ && !JSDOUBLE_IS_NEGZERO(d) \ - && ((d) == (i = (jsint)(d)))) + && ((d) == (i = (jsint)(d)))) + +#if defined(XP_WIN) +#define JSDOUBLE_COMPARE(LVAL, OP, RVAL, IFNAN) \ + ((JSDOUBLE_IS_NaN(LVAL) || JSDOUBLE_IS_NaN(RVAL)) \ + ? (IFNAN) \ + : (LVAL) OP (RVAL)) +#else +#define JSDOUBLE_COMPARE(LVAL, OP, RVAL, IFNAN) ((LVAL) OP (RVAL)) +#endif /* Initialize number constants and runtime state for the first context. */ extern JSBool @@ -144,6 +153,8 @@ extern void js_FinishRuntimeNumberState(JSContext *cx); /* Initialize the Number class, returning its prototype object. */ +extern JSClass js_NumberClass; + extern JSObject * js_InitNumberClass(JSContext *cx, JSObject *obj); @@ -159,7 +170,7 @@ extern const char js_parseInt_str[]; /* GC-allocate a new JS number. */ extern jsdouble * -js_NewDouble(JSContext *cx, jsdouble d); +js_NewDouble(JSContext *cx, jsdouble d, uintN gcflag); extern void js_FinalizeDouble(JSContext *cx, jsdouble *dp);