mirror of
https://github.com/dop251/goja.git
synced 2026-11-17 19:47:16 +00:00
* Return a Number from Math.sign when the argument converts to NaN or zero
Math.sign returned its argument itself for a NaN or zero result, so
Math.sign(null) was null, Math.sign("0") was "0" and Math.sign(undefined)
was undefined. ECMA-262 21.3.2.30 step 2 returns n, the Number from
ToNumber(x). Return the converted Number; floatToValue keeps -0.
* Use the pre-boxed values in Math.sign
Return _NaN, _negativeZero and _positiveZero for the NaN and zero results
instead of passing the number through floatToValue.
38 lines
1.5 KiB
38 lines
1.5 KiB