diff options
author | Nayeem Rahman <nayeemrmn99@gmail.com> | 2021-02-09 15:31:46 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-09 16:31:46 +0100 |
commit | 900953a65a7cb54eb8d11eba4a30e52da7dbb469 (patch) | |
tree | 7ca5b7b8261ffd92c945c618ac8bf9eaf15f5ceb /op_crates/fetch/11_streams.js | |
parent | 47b3e4bada01f29a6cf2a143b94d772242bbab67 (diff) |
fix(op_crates): Don't use `Deno.inspect` in op crates (#9332)
Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
Diffstat (limited to 'op_crates/fetch/11_streams.js')
-rw-r--r-- | op_crates/fetch/11_streams.js | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/op_crates/fetch/11_streams.js b/op_crates/fetch/11_streams.js index af9cc321f..5ddb1902a 100644 --- a/op_crates/fetch/11_streams.js +++ b/op_crates/fetch/11_streams.js @@ -7,8 +7,6 @@ "use strict"; ((window) => { - const customInspect = Symbol.for("Deno.customInspect"); - class AssertionError extends Error { constructor(msg) { super(msg); @@ -3224,10 +3222,8 @@ return iterator; } - [customInspect]() { - return `${this.constructor.name} ${ - Deno.inspect({ locked: this.locked }) - }`; + [Symbol.for("Deno.customInspect")](inspect) { + return `${this.constructor.name} ${inspect({ locked: this.locked })}`; } } @@ -3308,8 +3304,8 @@ readableStreamReaderGenericRelease(this); } - [customInspect]() { - return `${this.constructor.name} { closed: ${String(this.closed)} }`; + [Symbol.for("Deno.customInspect")](inspect) { + return `${this.constructor.name} ${inspect({ closed: this.closed })}`; } } @@ -3597,12 +3593,9 @@ return this[_writable]; } - [customInspect]() { + [Symbol.for("Deno.customInspect")](inspect) { return `${this.constructor.name} ${ - Deno.inspect( - { readable: this.readable, writable: this.writable }, - { depth: 1 }, - ) + inspect({ readable: this.readable, writable: this.writable }) }`; } } @@ -3736,10 +3729,8 @@ return acquireWritableStreamDefaultWriter(this); } - [customInspect]() { - return `${this.constructor.name} ${ - Deno.inspect({ locked: this.locked }) - }`; + [Symbol.for("Deno.customInspect")](inspect) { + return `${this.constructor.name} ${inspect({ locked: this.locked })}`; } } |