summaryrefslogtreecommitdiff
path: root/extensions/fetch
diff options
context:
space:
mode:
Diffstat (limited to 'extensions/fetch')
-rw-r--r--extensions/fetch/23_request.js20
-rw-r--r--extensions/fetch/23_response.js26
2 files changed, 27 insertions, 19 deletions
diff --git a/extensions/fetch/23_request.js b/extensions/fetch/23_request.js
index 829f7e6dc..1372125c1 100644
--- a/extensions/fetch/23_request.js
+++ b/extensions/fetch/23_request.js
@@ -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",
+ ],
+ }));
}
}
diff --git a/extensions/fetch/23_response.js b/extensions/fetch/23_response.js
index 11eb13570..0db20e90e 100644
--- a/extensions/fetch/23_response.js
+++ b/extensions/fetch/23_response.js
@@ -13,6 +13,7 @@
((window) => {
const webidl = window.__bootstrap.webidl;
+ const consoleInternal = window.__bootstrap.console;
const { HTTP_TAB_OR_SPACE, regexMatcher } = window.__bootstrap.infra;
const { extractBody, mixinBody } = window.__bootstrap.fetchBody;
const { getLocationHref } = window.__bootstrap.location;
@@ -377,17 +378,20 @@
}
[SymbolFor("Deno.customInspect")](inspect) {
- const inner = {
- body: this.body,
- bodyUsed: this.bodyUsed,
- headers: this.headers,
- ok: this.ok,
- redirected: this.redirected,
- status: this.status,
- statusText: this.statusText,
- url: this.url,
- };
- return `Response ${inspect(inner)}`;
+ return inspect(consoleInternal.createFilteredInspectProxy({
+ object: this,
+ evaluate: this instanceof Response,
+ keys: [
+ "body",
+ "bodyUsed",
+ "headers",
+ "ok",
+ "redirected",
+ "status",
+ "statusText",
+ "url",
+ ],
+ }));
}
}