| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 6576382 commit 8383c34
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -593,10 +593,8 @@ function formatValue(ctx, value, recurseTimes, ln) { | |||
| 593 | 593 | } | |
| 594 | 594 | ||
| 595 | 595 | function formatNumber(fn, value) { | |
| 596 | - // Format -0 as '-0'. A `value === -0` check won't distinguish 0 from -0. | ||
| 597 | - // Using a division check is currently faster than `Object.is(value, -0)` | ||
| 598 | - // as of V8 6.1. | ||
| 599 | - if (1 / value === -Infinity) | ||
| 596 | + // Format -0 as '-0'. Checking `value === -0` won't distinguish 0 from -0. | ||
| 597 | + if (Object.is(value, -0)) | ||
| 600 | 598 | return fn('-0', 'number'); | |
| 601 | 599 | return fn(`${value}`, 'number'); | |
| 602 | 600 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -416,6 +416,8 @@ assert.strictEqual( | |||
| 416 | 416 | // test positive/negative zero | |
| 417 | 417 | assert.strictEqual(util.inspect(0), '0'); | |
| 418 | 418 | assert.strictEqual(util.inspect(-0), '-0'); | |
| 419 | + // edge case from check | ||
| 420 | + assert.strictEqual(util.inspect(-5e-324), '-5e-324'); | ||
| 419 | 421 | ||
| 420 | 422 | // test for sparse array | |
| 421 | 423 | { | |
| Back | FazBrowse Home | New Git URL |
0 commit comments