| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 2331e9c commit 9dd840d
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -61,6 +61,9 @@ class Tracing { | |||
| 61 | 61 | } | |
| 62 | 62 | ||
| 63 | 63 | [customInspectSymbol](depth, opts) { | |
| 64 | + if (typeof depth === 'number' && depth < 0) | ||
| 65 | + return this; | ||
| 66 | + | ||
| 64 | 67 | const obj = { | |
| 65 | 68 | enabled: this.enabled, | |
| 66 | 69 | categories: this.categories | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2497,3 +2497,15 @@ assert.strictEqual( | |||
| 2497 | 2497 | assert(i < 2 || line.startsWith('\u001b[90m')); | |
| 2498 | 2498 | }); | |
| 2499 | 2499 | } | |
| 2500 | + | ||
| 2501 | + { | ||
| 2502 | + // Tracing class respects inspect depth. | ||
| 2503 | + try { | ||
| 2504 | + const trace = require('trace_events').createTracing({ categories: ['fo'] }); | ||
| 2505 | + const actual = util.inspect({ trace }, { depth: 0 }); | ||
| 2506 | + assert.strictEqual(actual, '{ trace: [Tracing] }'); | ||
| 2507 | + } catch (err) { | ||
| 2508 | + if (err.code !== 'ERR_TRACE_EVENTS_UNAVAILABLE') | ||
| 2509 | + throw err; | ||
| 2510 | + } | ||
| 2511 | + } | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments