We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 22e34d8 commit f5f4a43Copy full SHA for f5f4a43
lib/Runtime/Language/JavascriptConversion.inl
@@ -292,9 +292,15 @@ namespace Js {
292
{
293
return taggedInt;
294
}
295
-
296
#if FLOATVAR
297
- return value;
+ if (typeId == TypeIds_Number)
+ {
298
+ // NaN could have sign bit set, but that isn't observable so canonicalize to positive NaN
299
+ double numberValue = JavascriptNumber::GetValue(value);
300
+ return JavascriptNumber::IsNan(numberValue)
301
+ ? JavascriptNumber::ToVar(JavascriptNumber::NaN)
302
+ : value;
303
+ }
304
#else
305
return nullptr;
306
#endif
0 commit comments