From 05b49a803fb460c254d00fc71c5e8958215f92c7 Mon Sep 17 00:00:00 2001 From: Asher Gomez Date: Fri, 19 Apr 2024 20:50:18 +1000 Subject: [PATCH] FUTURE: remove `Deno.customInspect` (#23453) --- runtime/js/99_main.js | 2 +- tests/specs/future/runtime_api/main.js | 10 ++++++++-- tests/specs/future/runtime_api/main.out | 1 + 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/runtime/js/99_main.js b/runtime/js/99_main.js index 4c0a9b5e7d..8164e0c9a2 100644 --- a/runtime/js/99_main.js +++ b/runtime/js/99_main.js @@ -667,7 +667,7 @@ ObjectDefineProperties(finalDenoNs, { new Error().stack, 'Use `Symbol.for("Deno.customInspect")` instead.', ); - return customInspect; + return internals.future ? undefined : customInspect; }, }, }); diff --git a/tests/specs/future/runtime_api/main.js b/tests/specs/future/runtime_api/main.js index 5308bb73aa..a79185e925 100644 --- a/tests/specs/future/runtime_api/main.js +++ b/tests/specs/future/runtime_api/main.js @@ -61,8 +61,12 @@ if (Deno.build.os === "windows") { // TLS // Since these tests may run in parallel, ensure this port is unique to this file const tlsPort = 4510; -const cert = Deno.readTextFileSync("../../../testdata/tls/localhost.crt"); -const key = Deno.readTextFileSync("../../../testdata/tls/localhost.key"); +const cert = Deno.readTextFileSync( + new URL("../../../testdata/tls/localhost.crt", import.meta.url), +); +const key = Deno.readTextFileSync( + new URL("../../../testdata/tls/localhost.key", import.meta.url), +); const tlsListener = Deno.listenTls({ port: tlsPort, cert, key }); console.log("Deno.TlsListener.prototype.rid is", tlsListener.rid); @@ -88,4 +92,6 @@ try { } } +console.log("Deno.customInspect is", Deno.customInspect); + self.close(); diff --git a/tests/specs/future/runtime_api/main.out b/tests/specs/future/runtime_api/main.out index 8ecca657ff..1bc41c026e 100644 --- a/tests/specs/future/runtime_api/main.out +++ b/tests/specs/future/runtime_api/main.out @@ -34,3 +34,4 @@ Deno.TlsListener.prototype.rid is undefined Deno.TlsConn.prototype.rid is undefined Deno.FsWatcher.prototype.rid is undefined Deno.FsFile constructor is illegal +Deno.customInspect is undefined