| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent fee8a11 commit 3797625
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -628,7 +628,10 @@ function formatRaw(ctx, value, recurseTimes) { | |||
| 628 | 628 | } | |
| 629 | 629 | } else if (typeof value === 'function') { | |
| 630 | 630 | const type = constructor || tag || 'Function'; | |
| 631 | - const name = `${type}${value.name ? `: ${value.name}` : ''}`; | ||
| 631 | + let name = `${type}`; | ||
| 632 | + if (value.name && typeof value.name === 'string') { | ||
| 633 | + name += `: ${value.name}`; | ||
| 634 | + } | ||
| 632 | 635 | if (keys.length === 0) | |
| 633 | 636 | return ctx.stylize(`[${name}]`, 'special'); | |
| 634 | 637 | base = `[${name}]`; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -87,3 +87,17 @@ assert.strictEqual(util.inspect(proxy8, opts), expected8); | |||
| 87 | 87 | assert.strictEqual(util.inspect(proxy9, opts), expected9); | |
| 88 | 88 | assert.strictEqual(util.inspect(proxy8), '[Function: Date]'); | |
| 89 | 89 | assert.strictEqual(util.inspect(proxy9), '[Function: Date]'); | |
| 90 | + | ||
| 91 | + const proxy10 = new Proxy(() => {}, {}); | ||
| 92 | + const proxy11 = new Proxy(() => {}, { | ||
| 93 | + get() { | ||
| 94 | + return proxy11; | ||
| 95 | + }, | ||
| 96 | + apply() { | ||
| 97 | + return proxy11; | ||
| 98 | + } | ||
| 99 | + }); | ||
| 100 | + const expected10 = '[Function]'; | ||
| 101 | + const expected11 = '[Function]'; | ||
| 102 | + assert.strictEqual(util.inspect(proxy10), expected10); | ||
| 103 | + assert.strictEqual(util.inspect(proxy11), expected11); | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments