mirror of
https://github.com/zebrajr/node.git
synced 2025-12-06 12:20:27 +01:00
url: expose urlpattern as global
PR-URL: https://github.com/nodejs/node/pull/56950 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Matthew Aitken <maitken033380023@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
This commit is contained in:
parent
6088183906
commit
d1f8ccb10d
|
|
@ -1145,6 +1145,16 @@ added: v10.0.0
|
||||||
|
|
||||||
The WHATWG `URL` class. See the [`URL`][] section.
|
The WHATWG `URL` class. See the [`URL`][] section.
|
||||||
|
|
||||||
|
## `URLPattern`
|
||||||
|
|
||||||
|
<!-- YAML
|
||||||
|
added: REPLACEME
|
||||||
|
-->
|
||||||
|
|
||||||
|
<!-- type=global -->
|
||||||
|
|
||||||
|
The WHATWG `URLPattern` class. See the [`URLPattern`][] section.
|
||||||
|
|
||||||
## `URLSearchParams`
|
## `URLSearchParams`
|
||||||
|
|
||||||
<!-- YAML
|
<!-- YAML
|
||||||
|
|
@ -1262,6 +1272,7 @@ A browser-compatible implementation of [`WritableStreamDefaultWriter`][].
|
||||||
[`TextEncoder`]: util.md#class-utiltextencoder
|
[`TextEncoder`]: util.md#class-utiltextencoder
|
||||||
[`TransformStreamDefaultController`]: webstreams.md#class-transformstreamdefaultcontroller
|
[`TransformStreamDefaultController`]: webstreams.md#class-transformstreamdefaultcontroller
|
||||||
[`TransformStream`]: webstreams.md#class-transformstream
|
[`TransformStream`]: webstreams.md#class-transformstream
|
||||||
|
[`URLPattern`]: url.md#class-urlpattern
|
||||||
[`URLSearchParams`]: url.md#class-urlsearchparams
|
[`URLSearchParams`]: url.md#class-urlsearchparams
|
||||||
[`URL`]: url.md#class-url
|
[`URL`]: url.md#class-url
|
||||||
[`WebSocket`]: https://developer.mozilla.org/en-US/docs/Web/API/WebSocket
|
[`WebSocket`]: https://developer.mozilla.org/en-US/docs/Web/API/WebSocket
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@ const {
|
||||||
defineLazyProperties,
|
defineLazyProperties,
|
||||||
defineReplaceableLazyAttribute,
|
defineReplaceableLazyAttribute,
|
||||||
exposeLazyInterfaces,
|
exposeLazyInterfaces,
|
||||||
|
exposeInterface,
|
||||||
} = require('internal/util');
|
} = require('internal/util');
|
||||||
|
|
||||||
const {
|
const {
|
||||||
|
|
@ -63,8 +64,9 @@ exposeLazyInterfaces(globalThis, 'perf_hooks', [
|
||||||
defineReplaceableLazyAttribute(globalThis, 'perf_hooks', ['performance']);
|
defineReplaceableLazyAttribute(globalThis, 'perf_hooks', ['performance']);
|
||||||
|
|
||||||
// https://w3c.github.io/FileAPI/#creating-revoking
|
// https://w3c.github.io/FileAPI/#creating-revoking
|
||||||
const { installObjectURLMethods } = require('internal/url');
|
const { installObjectURLMethods, URLPattern } = require('internal/url');
|
||||||
installObjectURLMethods();
|
installObjectURLMethods();
|
||||||
|
exposeInterface(globalThis, 'URLPattern', URLPattern);
|
||||||
|
|
||||||
let fetchImpl;
|
let fetchImpl;
|
||||||
// https://fetch.spec.whatwg.org/#fetch-method
|
// https://fetch.spec.whatwg.org/#fetch-method
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,4 @@ const { WPTRunner } = require('../common/wpt');
|
||||||
const runner = new WPTRunner('urlpattern');
|
const runner = new WPTRunner('urlpattern');
|
||||||
|
|
||||||
runner.pretendGlobalThisAs('Window');
|
runner.pretendGlobalThisAs('Window');
|
||||||
// TODO(@anonrig): Remove this once URLPattern is global.
|
|
||||||
runner.setInitScript(`global.URLPattern = require('node:url').URLPattern;`);
|
|
||||||
runner.runJsTests();
|
runner.runJsTests();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user