mirror of
https://github.com/nodejs/node.git
synced 2025-08-15 13:48:44 +02: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
3 changed files with 14 additions and 3 deletions
|
@ -1145,6 +1145,16 @@ added: v10.0.0
|
|||
|
||||
The WHATWG `URL` class. See the [`URL`][] section.
|
||||
|
||||
## `URLPattern`
|
||||
|
||||
<!-- YAML
|
||||
added: REPLACEME
|
||||
-->
|
||||
|
||||
<!-- type=global -->
|
||||
|
||||
The WHATWG `URLPattern` class. See the [`URLPattern`][] section.
|
||||
|
||||
## `URLSearchParams`
|
||||
|
||||
<!-- YAML
|
||||
|
@ -1262,6 +1272,7 @@ A browser-compatible implementation of [`WritableStreamDefaultWriter`][].
|
|||
[`TextEncoder`]: util.md#class-utiltextencoder
|
||||
[`TransformStreamDefaultController`]: webstreams.md#class-transformstreamdefaultcontroller
|
||||
[`TransformStream`]: webstreams.md#class-transformstream
|
||||
[`URLPattern`]: url.md#class-urlpattern
|
||||
[`URLSearchParams`]: url.md#class-urlsearchparams
|
||||
[`URL`]: url.md#class-url
|
||||
[`WebSocket`]: https://developer.mozilla.org/en-US/docs/Web/API/WebSocket
|
||||
|
|
|
@ -19,6 +19,7 @@ const {
|
|||
defineLazyProperties,
|
||||
defineReplaceableLazyAttribute,
|
||||
exposeLazyInterfaces,
|
||||
exposeInterface,
|
||||
} = require('internal/util');
|
||||
|
||||
const {
|
||||
|
@ -63,8 +64,9 @@ exposeLazyInterfaces(globalThis, 'perf_hooks', [
|
|||
defineReplaceableLazyAttribute(globalThis, 'perf_hooks', ['performance']);
|
||||
|
||||
// https://w3c.github.io/FileAPI/#creating-revoking
|
||||
const { installObjectURLMethods } = require('internal/url');
|
||||
const { installObjectURLMethods, URLPattern } = require('internal/url');
|
||||
installObjectURLMethods();
|
||||
exposeInterface(globalThis, 'URLPattern', URLPattern);
|
||||
|
||||
let fetchImpl;
|
||||
// https://fetch.spec.whatwg.org/#fetch-method
|
||||
|
|
|
@ -5,6 +5,4 @@ const { WPTRunner } = require('../common/wpt');
|
|||
const runner = new WPTRunner('urlpattern');
|
||||
|
||||
runner.pretendGlobalThisAs('Window');
|
||||
// TODO(@anonrig): Remove this once URLPattern is global.
|
||||
runner.setInitScript(`global.URLPattern = require('node:url').URLPattern;`);
|
||||
runner.runJsTests();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue