Harness: properly format negative zero

This commit is contained in:
Alexey Shvayka 2020-03-25 15:05:43 +02:00 committed by Rick Waldron
parent 1e63ce0eae
commit 96cf75770e
2 changed files with 5 additions and 0 deletions

View File

@ -96,6 +96,10 @@ assert.throws = function (expectedErrorConstructor, func, message) {
assert._toString = function (value) {
try {
if (value === 0 && 1 / value === -Infinity) {
return '-0';
}
return String(value);
} catch (err) {
if (err.name === 'TypeError') {

View File

@ -18,6 +18,7 @@ try {
'" was thrown.'
);
}
assert.notSameValue(err.message.indexOf('-0'), -1);
}
if (threw === false) {