From d832d2bfd1f0487181f96bdecd7a28968a150fac Mon Sep 17 00:00:00 2001 From: Yoshiya Hinosawa Date: Fri, 25 Jun 2021 16:19:18 +0900 Subject: chore(ext/console): deprecate Deno.customInspect (#10035) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Bartek IwaƄczuk --- runtime/js/40_permissions.js | 2 +- runtime/js/90_deno_ns.js | 2 ++ runtime/js/99_main.js | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) (limited to 'runtime') diff --git a/runtime/js/40_permissions.js b/runtime/js/40_permissions.js index b36fb643a..00b1a2974 100644 --- a/runtime/js/40_permissions.js +++ b/runtime/js/40_permissions.js @@ -87,7 +87,7 @@ return dispatched; } - [Symbol.for("Deno.customInspect")](inspect) { + [Symbol.for("Deno.privateCustomInspect")](inspect) { return `${this.constructor.name} ${ inspect({ state: this.state, onchange: this.onchange }) }`; diff --git a/runtime/js/90_deno_ns.js b/runtime/js/90_deno_ns.js index 9d0590878..3d17fccf6 100644 --- a/runtime/js/90_deno_ns.js +++ b/runtime/js/90_deno_ns.js @@ -53,6 +53,8 @@ ftruncateSync: __bootstrap.fs.ftruncateSync, ftruncate: __bootstrap.fs.ftruncate, errors: __bootstrap.errors.errors, + // TODO(kt3k): Remove this export at v2 + // See https://github.com/denoland/deno/issues/9294 customInspect: __bootstrap.console.customInspect, inspect: __bootstrap.console.inspect, env: __bootstrap.os.env, diff --git a/runtime/js/99_main.js b/runtime/js/99_main.js index d0e86bce7..db334caea 100644 --- a/runtime/js/99_main.js +++ b/runtime/js/99_main.js @@ -247,7 +247,7 @@ delete Object.prototype.__proto__; webidl.illegalConstructor(); } - [Symbol.for("Deno.customInspect")](inspect) { + [Symbol.for("Deno.privateCustomInspect")](inspect) { return `${this.constructor.name} ${inspect({})}`; } } @@ -270,7 +270,7 @@ delete Object.prototype.__proto__; webidl.illegalConstructor(); } - [Symbol.for("Deno.customInspect")](inspect) { + [Symbol.for("Deno.privateCustomInspect")](inspect) { return `${this.constructor.name} ${inspect({})}`; } } -- cgit v1.2.3