mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-10 20:05:49 +00:00
Bug 1165533 - Test that the DOM reflection of signed-integer properties never exposes such values as -0, only as +0. r=Ms2ger
--HG-- extra : rebase_source : 9e4303c00c8259923255528ff4100b583209db82
This commit is contained in:
parent
04b22e3bcf
commit
97c040275e
@ -502,8 +502,10 @@ function reflectInt(aParameters)
|
||||
if (result) {
|
||||
var resultInt = parseInt(result[1], 10);
|
||||
if ((nonNegative ? 0 : -0x80000000) <= resultInt && resultInt <= 0x7FFFFFFF) {
|
||||
// If the value is within allowed value range for signed/unsigned integer, return value
|
||||
return resultInt;
|
||||
// If the value is within allowed value range for signed/unsigned
|
||||
// integer, return it -- but add 0 to it to convert a possible -0 into
|
||||
// +0, the only zero present in the signed integer range.
|
||||
return resultInt + 0;
|
||||
}
|
||||
}
|
||||
return defaultValue;
|
||||
|
Loading…
Reference in New Issue
Block a user