diff --git a/harness/assert.js b/harness/assert.js index 9dfbd40911..886ad8f47e 100644 --- a/harness/assert.js +++ b/harness/assert.js @@ -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') { diff --git a/test/harness/assert-samevalue-zeros.js b/test/harness/assert-samevalue-zeros.js index a4a44a031d..762634a67d 100644 --- a/test/harness/assert-samevalue-zeros.js +++ b/test/harness/assert-samevalue-zeros.js @@ -18,6 +18,7 @@ try { '" was thrown.' ); } + assert.notSameValue(err.message.indexOf('-0'), -1); } if (threw === false) {