mirror of
https://github.com/denoland/deno.git
synced 2025-08-02 18:12:39 +00:00
fix: inspecting prototypes of built-ins with custom inspect implementations should not throw (#11308)
This commit is contained in:
parent
5e092b19fe
commit
5fa58c9216
14 changed files with 325 additions and 123 deletions
|
@ -12,6 +12,7 @@
|
|||
|
||||
((window) => {
|
||||
const webidl = window.__bootstrap.webidl;
|
||||
const consoleInternal = window.__bootstrap.console;
|
||||
const { HTTP_TOKEN_CODE_POINT_RE, byteUpperCase } = window.__bootstrap.infra;
|
||||
const { URL } = window.__bootstrap.url;
|
||||
const { guardFromHeaders } = window.__bootstrap.headers;
|
||||
|
@ -393,14 +394,17 @@
|
|||
}
|
||||
|
||||
[SymbolFor("Deno.customInspect")](inspect) {
|
||||
const inner = {
|
||||
bodyUsed: this.bodyUsed,
|
||||
headers: this.headers,
|
||||
method: this.method,
|
||||
redirect: this.redirect,
|
||||
url: this.url,
|
||||
};
|
||||
return `Request ${inspect(inner)}`;
|
||||
return inspect(consoleInternal.createFilteredInspectProxy({
|
||||
object: this,
|
||||
evaluate: this instanceof Request,
|
||||
keys: [
|
||||
"bodyUsed",
|
||||
"headers",
|
||||
"method",
|
||||
"redirect",
|
||||
"url",
|
||||
],
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue