-
Sub-task
-
Resolution: Fixed
-
P4
-
None
-
None
-
b89
-
Verified
We currently implement these operations in JSType using a long/int cast and a bitmask operation to squeeze them into 32 or 16 bits. But ECMA spec requires to follow IEEE 754 standard which yields different results for some numbers.
This should fix the following:
9223372036854775807|0
=> should return 0
9223372036854775807>>>0
=> should return 0 instead of 4294967295
Also visible in other places where ToUint32() is used, e.g.
Array.prototype.map.call({length: 9223372036854775807, get 0(){print("get 0")}}, function(){}).length
=> should return 0 instead of 4294967295
parseInt("10",9223372036854775807)
=> should return 10 instead of NaN
This should fix the following:
9223372036854775807|0
=> should return 0
9223372036854775807>>>0
=> should return 0 instead of 4294967295
Also visible in other places where ToUint32() is used, e.g.
Array.prototype.map.call({length: 9223372036854775807, get 0(){print("get 0")}}, function(){}).length
=> should return 0 instead of 4294967295
parseInt("10",9223372036854775807)
=> should return 10 instead of NaN