fix(op_crates): Don't use Deno.inspect in op crates (#9332)

Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
This commit is contained in:
Nayeem Rahman 2021-02-09 15:31:46 +00:00 committed by GitHub
parent 47b3e4bada
commit 900953a65a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 48 additions and 63 deletions

View file

@ -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);