summaryrefslogtreecommitdiff
path: root/runtime/js/02_console.js
diff options
context:
space:
mode:
authorNayeem Rahman <nayeemrmn99@gmail.com>2021-02-09 15:31:46 +0000
committerGitHub <noreply@github.com>2021-02-09 16:31:46 +0100
commit900953a65a7cb54eb8d11eba4a30e52da7dbb469 (patch)
tree7ca5b7b8261ffd92c945c618ac8bf9eaf15f5ceb /runtime/js/02_console.js
parent47b3e4bada01f29a6cf2a143b94d772242bbab67 (diff)
fix(op_crates): Don't use `Deno.inspect` in op crates (#9332)
Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
Diffstat (limited to 'runtime/js/02_console.js')
-rw-r--r--runtime/js/02_console.js6
1 files changed, 5 insertions, 1 deletions
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);