@@ -41116,9 +41116,9 @@ static const JSCFunctionListEntry js_number_funcs[] = {
41116
41116
JS_CFUNC_DEF("isSafeInteger", 1, js_number_isSafeInteger ),
41117
41117
JS_PROP_DOUBLE_DEF("MAX_VALUE", 1.7976931348623157e+308, 0 ),
41118
41118
JS_PROP_DOUBLE_DEF("MIN_VALUE", 5e-324, 0 ),
41119
- JS_PROP_U2D_DEF ("NaN", 0x7FF8ull<<48 , 0 ), // workaround for msvc
41120
- JS_PROP_DOUBLE_DEF("NEGATIVE_INFINITY", -INFINITY , 0 ),
41121
- JS_PROP_DOUBLE_DEF("POSITIVE_INFINITY", INFINITY , 0 ),
41119
+ JS_PROP_DOUBLE_DEF ("NaN", 0.0/0.0 , 0 ),
41120
+ JS_PROP_DOUBLE_DEF("NEGATIVE_INFINITY", -1.0/0.0 , 0 ),
41121
+ JS_PROP_DOUBLE_DEF("POSITIVE_INFINITY", 1.0/0.0 , 0 ),
41122
41122
JS_PROP_DOUBLE_DEF("EPSILON", 2.220446049250313e-16, 0 ), /* ES6 */
41123
41123
JS_PROP_DOUBLE_DEF("MAX_SAFE_INTEGER", 9007199254740991.0, 0 ), /* ES6 */
41124
41124
JS_PROP_DOUBLE_DEF("MIN_SAFE_INTEGER", -9007199254740991.0, 0 ), /* ES6 */
@@ -50196,8 +50196,8 @@ static const JSCFunctionListEntry js_global_funcs[] = {
50196
50196
JS_CFUNC_MAGIC_DEF("encodeURIComponent", 1, js_global_encodeURI, 1 ),
50197
50197
JS_CFUNC_DEF("escape", 1, js_global_escape ),
50198
50198
JS_CFUNC_DEF("unescape", 1, js_global_unescape ),
50199
- JS_PROP_DOUBLE_DEF("Infinity", 1.0 / 0.0, 0 ),
50200
- JS_PROP_U2D_DEF ("NaN", 0x7FF8ull<<48 , 0 ), // workaround for msvc
50199
+ JS_PROP_DOUBLE_DEF("Infinity", 1.0/ 0.0, 0 ),
50200
+ JS_PROP_DOUBLE_DEF ("NaN", 0.0/0.0 , 0 ),
50201
50201
JS_PROP_UNDEFINED_DEF("undefined", 0 ),
50202
50202
JS_PROP_STRING_DEF("[Symbol.toStringTag]", "global", JS_PROP_CONFIGURABLE ),
50203
50203
};
@@ -50337,7 +50337,7 @@ static double time_clip(double t) {
50337
50337
if (t >= -8.64e15 && t <= 8.64e15)
50338
50338
return trunc(t) + 0.0; /* convert -0 to +0 */
50339
50339
else
50340
- return NAN ;
50340
+ return JS_FLOAT64_NAN ;
50341
50341
}
50342
50342
50343
50343
/* The spec mandates the use of 'double' and it specifies the order
@@ -50357,7 +50357,7 @@ static double set_date_fields(double fields[minimum_length(7)], int is_local) {
50357
50357
if (mn < 0)
50358
50358
mn += 12;
50359
50359
if (ym < -271821 || ym > 275760)
50360
- return NAN ;
50360
+ return JS_FLOAT64_NAN ;
50361
50361
50362
50362
yi = ym;
50363
50363
mi = mn;
@@ -50389,7 +50389,7 @@ static double set_date_fields(double fields[minimum_length(7)], int is_local) {
50389
50389
/* emulate 21.4.1.16 MakeDate ( day, time ) */
50390
50390
tv = (temp = day * 86400000) + time; /* prevent generation of FMA */
50391
50391
if (!isfinite(tv))
50392
- return NAN ;
50392
+ return JS_FLOAT64_NAN ;
50393
50393
50394
50394
/* adjust for local time and clip */
50395
50395
if (is_local) {
@@ -50428,7 +50428,7 @@ static JSValue set_date_field(JSContext *ctx, JSValue this_val,
50428
50428
int res, first_field, end_field, is_local, i, n;
50429
50429
double d, a;
50430
50430
50431
- d = NAN ;
50431
+ d = JS_FLOAT64_NAN ;
50432
50432
first_field = (magic >> 8) & 0x0F;
50433
50433
end_field = (magic >> 4) & 0x0F;
50434
50434
is_local = magic & 0x0F;
@@ -50628,7 +50628,7 @@ static JSValue js_date_constructor(JSContext *ctx, JSValue new_target,
50628
50628
if (i == 0 && fields[0] >= 0 && fields[0] < 100)
50629
50629
fields[0] += 1900;
50630
50630
}
50631
- val = (i == n) ? set_date_fields(fields, 1) : NAN ;
50631
+ val = (i == n) ? set_date_fields(fields, 1) : JS_FLOAT64_NAN ;
50632
50632
}
50633
50633
has_val:
50634
50634
rv = js_create_from_ctor(ctx, new_target, JS_CLASS_DATE);
0 commit comments