You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The URL polyfill constructor should throw an error if passed an invalid URL.
newURL('invalid');// Expected: Uncaught TypeError: Failed to construct 'URL': Invalid URL// Actual: (successfully returns new instance of URL)
For context, this affects us in that we use the throwing of an error as an indication of whether a given URL is a valid URL. Thus, without a thrown error, invalid URLs would be incorrectly reported as being valid when the polyfill is used.
[type]: Bug report
What
The
URL
polyfill constructor should throw an error if passed an invalid URL.For context, this affects us in that we use the throwing of an error as an indication of whether a given URL is a valid URL. Thus, without a thrown error, invalid URLs would be incorrectly reported as being valid when the polyfill is used.
https://github.com/WordPress/gutenberg/blob/59d7463/packages/url/src/is-url.js
(Related originating conversation: WordPress/gutenberg#20172 (comment))
Details
References:
https://developer.mozilla.org/en-US/docs/Web/API/URL/URL
https://url.spec.whatwg.org/#dom-url-url
Other Implementations:
Relevant Code:
https://github.com/Financial-Times/polyfill-library/blob/5360b0dd924cc08ca1a815e003033c7e489c7ab0/polyfills/URL/polyfill.js#L284-L452
The text was updated successfully, but these errors were encountered: