mirror of
https://github.com/tc39/test262.git
synced 2025-07-21 13:04:39 +02:00
Harness: properly format negative zero
This commit is contained in:
parent
1e63ce0eae
commit
96cf75770e
@ -96,6 +96,10 @@ assert.throws = function (expectedErrorConstructor, func, message) {
|
|||||||
|
|
||||||
assert._toString = function (value) {
|
assert._toString = function (value) {
|
||||||
try {
|
try {
|
||||||
|
if (value === 0 && 1 / value === -Infinity) {
|
||||||
|
return '-0';
|
||||||
|
}
|
||||||
|
|
||||||
return String(value);
|
return String(value);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
if (err.name === 'TypeError') {
|
if (err.name === 'TypeError') {
|
||||||
|
@ -18,6 +18,7 @@ try {
|
|||||||
'" was thrown.'
|
'" was thrown.'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
assert.notSameValue(err.message.indexOf('-0'), -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (threw === false) {
|
if (threw === false) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user