Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions doc/api/globals.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion lib/internal/bootstrap/web/exposed-window-or-worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const {
defineLazyProperties,
defineReplaceableLazyAttribute,
exposeLazyInterfaces,
exposeInterface,
} = require('internal/util');

const {
Expand Down Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions test/wpt/test-urlpattern.js
Original file line number Diff line number Diff line change
Expand Up @@ -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