Skip to content

Commit 71a3c54

Browse files
committed
Work around MSVC definition of infinity
Use the same implementation as in js_number_funcs. Ref: #1275 (comment)
1 parent d17c322 commit 71a3c54

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

quickjs.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53996,8 +53996,10 @@ static const JSCFunctionListEntry js_global_funcs[] = {
5399653996
JS_CFUNC_MAGIC_DEF("encodeURIComponent", 1, js_global_encodeURI, 1 ),
5399753997
JS_CFUNC_DEF("escape", 1, js_global_escape ),
5399853998
JS_CFUNC_DEF("unescape", 1, js_global_unescape ),
53999-
JS_PROP_DOUBLE_DEF("Infinity", 1.0 / 0.0, 0 ),
54000-
JS_PROP_U2D_DEF("NaN", 0x7FF8ull<<48, 0 ), // workaround for msvc
53999+
// workarounds for msvc & djgpp where NAN and INFINITY
54000+
// are not compile-time expressions
54001+
JS_PROP_U2D_DEF("Infinity", 0x7FF0ull<<48, 0 ),
54002+
JS_PROP_U2D_DEF("NaN", 0x7FF8ull<<48, 0 ),
5400154003
JS_PROP_UNDEFINED_DEF("undefined", 0 ),
5400254004
JS_PROP_STRING_DEF("[Symbol.toStringTag]", "global", JS_PROP_CONFIGURABLE ),
5400354005
JS_CFUNC_DEF("eval", 1, js_global_eval ),

0 commit comments

Comments
 (0)