| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 1d6c17e commit 6d1527b
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -348,7 +348,11 @@ function formatValue(ctx, value, recurseTimes) { | |||
| 348 | 348 | return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); | |
| 349 | 349 | } | |
| 350 | 350 | if (isDate(value)) { | |
| 351 | - return ctx.stylize(Date.prototype.toISOString.call(value), 'date'); | ||
| 351 | + if (Number.isNaN(value.getTime())) { | ||
| 352 | + return ctx.stylize(value.toString(), 'date'); | ||
| 353 | + } else { | ||
| 354 | + return ctx.stylize(Date.prototype.toISOString.call(value), 'date'); | ||
| 355 | + } | ||
| 352 | 356 | } | |
| 353 | 357 | if (isError(value)) { | |
| 354 | 358 | return formatError(value); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -12,8 +12,9 @@ assert.equal(util.inspect(function() {}), '[Function]'); | |||
| 12 | 12 | assert.equal(util.inspect(undefined), 'undefined'); | |
| 13 | 13 | assert.equal(util.inspect(null), 'null'); | |
| 14 | 14 | assert.equal(util.inspect(/foo(bar\n)?/gi), '/foo(bar\\n)?/gi'); | |
| 15 | - assert.equal(util.inspect(new Date('Sun, 14 Feb 2010 11:48:40 GMT')), | ||
| 15 | + assert.strictEqual(util.inspect(new Date('Sun, 14 Feb 2010 11:48:40 GMT')), | ||
| 16 | 16 | new Date('2010-02-14T12:48:40+01:00').toISOString()); | |
| 17 | + assert.strictEqual(util.inspect(new Date('')), (new Date('')).toString()); | ||
| 17 | 18 | ||
| 18 | 19 | assert.equal(util.inspect('\n\u0001'), "'\\n\\u0001'"); | |
| 19 | 20 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments