From 1f83b56d439cdf2fb14712bb5820ede97f283326 Mon Sep 17 00:00:00 2001 From: Luca Casonato Date: Mon, 31 May 2021 11:03:17 +0200 Subject: fix: remove unimplemented Request attributes (#10784) Not having them is better than throwing "unimplemented" errors on access. --- extensions/fetch/23_request.js | 111 ----------------------------------------- 1 file changed, 111 deletions(-) (limited to 'extensions/fetch/23_request.js') 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 }, ], ); -- cgit v1.2.3