Export js_NaN.

This commit is contained in:
Andreas Gal 2008-08-21 00:13:40 -07:00
parent e26e3234f4
commit a7b0f45c3f
2 changed files with 5 additions and 3 deletions

View File

@ -557,7 +557,7 @@ static JSConstDoubleSpec number_constants[] = {
{0,0,0,{0,0,0}}
};
static jsdouble NaN;
jsdouble js_NaN;
#if (defined XP_WIN || defined XP_OS2) && \
!defined WINCE && \
@ -592,8 +592,8 @@ js_InitRuntimeNumberState(JSContext *cx)
u.s.hi = JSDOUBLE_HI32_EXPMASK | JSDOUBLE_HI32_MANTMASK;
u.s.lo = 0xffffffff;
number_constants[NC_NaN].dval = NaN = u.d;
rt->jsNaN = js_NewWeaklyRootedDouble(cx, NaN);
number_constants[NC_NaN].dval = js_NaN = u.d;
rt->jsNaN = js_NewWeaklyRootedDouble(cx, js_NaN);
if (!rt->jsNaN)
return JS_FALSE;

View File

@ -143,6 +143,8 @@ typedef union jsdpun {
#define JSDOUBLE_COMPARE(LVAL, OP, RVAL, IFNAN) ((LVAL) OP (RVAL))
#endif
extern jsdouble js_NaN;
/* Initialize number constants and runtime state for the first context. */
extern JSBool
js_InitRuntimeNumberState(JSContext *cx);