From 900953a65a7cb54eb8d11eba4a30e52da7dbb469 Mon Sep 17 00:00:00 2001 From: Nayeem Rahman Date: Tue, 9 Feb 2021 15:31:46 +0000 Subject: fix(op_crates): Don't use `Deno.inspect` in op crates (#9332) Co-authored-by: Yoshiya Hinosawa --- runtime/js/02_console.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'runtime/js/02_console.js') diff --git a/runtime/js/02_console.js b/runtime/js/02_console.js index fb659e342..bd6565e0e 100644 --- a/runtime/js/02_console.js +++ b/runtime/js/02_console.js @@ -873,7 +873,11 @@ nonUniqueCustomInspect in value && typeof value[nonUniqueCustomInspect] === "function" ) { - return String(value[nonUniqueCustomInspect]()); + // TODO(nayeemrmn): `inspect` is passed as an argument because custom + // inspect implementations in `op_crates` need it, but may not have access + // to the `Deno` namespace in web workers. Remove when the `Deno` + // namespace is always enabled. + return String(value[nonUniqueCustomInspect](inspect)); } if (value instanceof Error) { return String(value.stack); -- cgit v1.2.3