summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuca Casonato <lucacasonato@yahoo.com>2021-05-31 11:03:17 +0200
committerGitHub <noreply@github.com>2021-05-31 11:03:17 +0200
commit1f83b56d439cdf2fb14712bb5820ede97f283326 (patch)
tree1d2b4d10f36d7072dc9f8382ae25584a6e04cada
parent3a33510bd4a169aba00393c2b7e88bf7fa0cad06 (diff)
fix: remove unimplemented Request attributes (#10784)
Not having them is better than throwing "unimplemented" errors on access.
-rw-r--r--extensions/fetch/23_request.js111
-rw-r--r--tools/wpt/expectation.json13
2 files changed, 12 insertions, 112 deletions
diff --git a/extensions/fetch/23_request.js b/extensions/fetch/23_request.js
index de1bdd211..ac38ce552 100644
--- a/extensions/fetch/23_request.js
+++ b/extensions/fetch/23_request.js
@@ -316,66 +316,11 @@
return this[_headers];
}
- get destination() {
- webidl.assertBranded(this, Request);
- throw new TypeError("This property is not implemented.");
- }
-
- get referrer() {
- webidl.assertBranded(this, Request);
- throw new TypeError("This property is not implemented.");
- }
-
- get referrerPolicy() {
- webidl.assertBranded(this, Request);
- throw new TypeError("This property is not implemented.");
- }
-
- get mode() {
- webidl.assertBranded(this, Request);
- throw new TypeError("This property is not implemented.");
- }
-
- get credentials() {
- webidl.assertBranded(this, Request);
- throw new TypeError("This property is not implemented.");
- }
-
- get cache() {
- webidl.assertBranded(this, Request);
- throw new TypeError("This property is not implemented.");
- }
-
get redirect() {
webidl.assertBranded(this, Request);
return this[_request].redirectMode;
}
- get integrity() {
- webidl.assertBranded(this, Request);
- throw new TypeError("This property is not implemented.");
- }
-
- get keepalive() {
- webidl.assertBranded(this, Request);
- throw new TypeError("This property is not implemented.");
- }
-
- get isReloadNavigation() {
- webidl.assertBranded(this, Request);
- throw new TypeError("This property is not implemented.");
- }
-
- get isHistoryNavigation() {
- webidl.assertBranded(this, Request);
- throw new TypeError("This property is not implemented.");
- }
-
- get signal() {
- webidl.assertBranded(this, Request);
- throw new TypeError("This property is not implemented.");
- }
-
clone() {
webidl.assertBranded(this, Request);
if (this[_body] && this[_body].unusable()) {
@@ -438,46 +383,6 @@
}
return webidl.converters["USVString"](V, opts);
};
-
- webidl.converters["ReferrerPolicy"] = webidl.createEnumConverter(
- "ReferrerPolicy",
- [
- "",
- "no-referrer",
- "no-referrer-when-downgrade",
- "same-origin",
- "origin",
- "strict-origin",
- "origin-when-cross-origin",
- "strict-origin-when-cross-origin",
- "unsafe-url",
- ],
- );
- webidl.converters["RequestMode"] = webidl.createEnumConverter("RequestMode", [
- "navigate",
- "same-origin",
- "no-cors",
- "cors",
- ]);
- webidl.converters["RequestCredentials"] = webidl.createEnumConverter(
- "RequestCredentials",
- [
- "omit",
- "same-origin",
- "include",
- ],
- );
- webidl.converters["RequestCache"] = webidl.createEnumConverter(
- "RequestCache",
- [
- "default",
- "no-store",
- "reload",
- "no-cache",
- "force-cache",
- "only-if-cached",
- ],
- );
webidl.converters["RequestRedirect"] = webidl.createEnumConverter(
"RequestRedirect",
[
@@ -497,23 +402,7 @@
webidl.converters["BodyInit"],
),
},
- { key: "referrer", converter: webidl.converters["USVString"] },
- { key: "referrerPolicy", converter: webidl.converters["ReferrerPolicy"] },
- { key: "mode", converter: webidl.converters["RequestMode"] },
- {
- key: "credentials",
- converter: webidl.converters["RequestCredentials"],
- },
- { key: "cache", converter: webidl.converters["RequestCache"] },
{ key: "redirect", converter: webidl.converters["RequestRedirect"] },
- { key: "integrity", converter: webidl.converters["DOMString"] },
- { key: "keepalive", converter: webidl.converters["boolean"] },
- {
- key: "signal",
- converter: webidl.createNullableConverter(
- webidl.converters["AbortSignal"],
- ),
- },
{ key: "client", converter: webidl.converters.any },
],
);
diff --git a/tools/wpt/expectation.json b/tools/wpt/expectation.json
index f504357f7..e233dbdef 100644
--- a/tools/wpt/expectation.json
+++ b/tools/wpt/expectation.json
@@ -942,6 +942,17 @@
"Request interface: attribute signal",
"Request interface: attribute body",
"Request interface: attribute bodyUsed",
+ "Request interface: new Request('about:blank') must inherit property \"destination\" with the proper type",
+ "Request interface: new Request('about:blank') must inherit property \"referrer\" with the proper type",
+ "Request interface: new Request('about:blank') must inherit property \"referrerPolicy\" with the proper type",
+ "Request interface: new Request('about:blank') must inherit property \"mode\" with the proper type",
+ "Request interface: new Request('about:blank') must inherit property \"credentials\" with the proper type",
+ "Request interface: new Request('about:blank') must inherit property \"cache\" with the proper type",
+ "Request interface: new Request('about:blank') must inherit property \"integrity\" with the proper type",
+ "Request interface: new Request('about:blank') must inherit property \"keepalive\" with the proper type",
+ "Request interface: new Request('about:blank') must inherit property \"isReloadNavigation\" with the proper type",
+ "Request interface: new Request('about:blank') must inherit property \"isHistoryNavigation\" with the proper type",
+ "Request interface: new Request('about:blank') must inherit property \"signal\" with the proper type",
"Response interface: operation error()",
"Response interface: operation redirect(USVString, optional unsigned short)",
"Response interface: attribute body",
@@ -1084,4 +1095,4 @@
"set.any.html": true
}
}
-}
+} \ No newline at end of file