Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 281f176

Browse filesBrowse files
panvatargos
authored andcommitted
lib: fix DOMException property descriptors after being lazy loaded
PR-URL: #46799 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de>
1 parent 2f09d3f commit 281f176
Copy full SHA for 281f176

File tree

Expand file treeCollapse file tree

3 files changed

+7
-11
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

3 files changed

+7
-11
lines changed
Open diff view settings
Collapse file

‎lib/internal/bootstrap/browser.js‎

Copy file name to clipboardExpand all lines: lib/internal/bootstrap/browser.js
+5-1Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,11 @@ exposeInterface(globalThis, 'URL', URL);
2626
exposeInterface(globalThis, 'URLSearchParams', URLSearchParams);
2727
exposeGetterAndSetter(globalThis,
2828
'DOMException',
29-
lazyDOMExceptionClass,
29+
() => {
30+
const DOMException = lazyDOMExceptionClass();
31+
exposeInterface(globalThis, 'DOMException', DOMException);
32+
return DOMException;
33+
},
3034
(value) => {
3135
exposeInterface(globalThis, 'DOMException', value);
3236
});
Collapse file

‎test/common/wpt.js‎

Copy file name to clipboardExpand all lines: test/common/wpt.js
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -501,6 +501,7 @@ class WPTRunner {
501501

502502
loadLazyGlobals() {
503503
const lazyProperties = [
504+
'DOMException',
504505
'Performance', 'PerformanceEntry', 'PerformanceMark', 'PerformanceMeasure',
505506
'PerformanceObserver', 'PerformanceObserverEntryList', 'PerformanceResourceTiming',
506507
'Blob', 'atob', 'btoa',
Collapse file

‎test/wpt/test-domexception.js‎

Copy file name to clipboardExpand all lines: test/wpt/test-domexception.js
+1-10Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,6 @@ const { WPTRunner } = require('../common/wpt');
44

55
const runner = new WPTRunner('webidl/ecmascript-binding/es-exceptions');
66

7-
runner.setFlags(['--expose-internals']);
8-
runner.setInitScript(`
9-
const { internalBinding } = require('internal/test/binding');
10-
const { DOMException } = internalBinding('messaging');
11-
Object.defineProperty(global, 'DOMException', {
12-
writable: true,
13-
configurable: true,
14-
value: DOMException,
15-
});
16-
`);
7+
runner.loadLazyGlobals();
178

189
runner.runJsTests();

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.