lib: fix DOMException property descriptors after being lazy loaded
PR-URL: https://github.com/nodejs/node/pull/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>
This commit is contained in:
parent
ea1dd1ba1f
commit
f85113bf1c
@ -26,7 +26,11 @@ exposeInterface(globalThis, 'URL', URL);
|
||||
exposeInterface(globalThis, 'URLSearchParams', URLSearchParams);
|
||||
exposeGetterAndSetter(globalThis,
|
||||
'DOMException',
|
||||
lazyDOMExceptionClass,
|
||||
() => {
|
||||
const DOMException = lazyDOMExceptionClass();
|
||||
exposeInterface(globalThis, 'DOMException', DOMException);
|
||||
return DOMException;
|
||||
},
|
||||
(value) => {
|
||||
exposeInterface(globalThis, 'DOMException', value);
|
||||
});
|
||||
|
@ -501,6 +501,7 @@ class WPTRunner {
|
||||
|
||||
loadLazyGlobals() {
|
||||
const lazyProperties = [
|
||||
'DOMException',
|
||||
'Performance', 'PerformanceEntry', 'PerformanceMark', 'PerformanceMeasure',
|
||||
'PerformanceObserver', 'PerformanceObserverEntryList', 'PerformanceResourceTiming',
|
||||
'Blob', 'atob', 'btoa',
|
||||
|
@ -4,15 +4,6 @@ const { WPTRunner } = require('../common/wpt');
|
||||
|
||||
const runner = new WPTRunner('webidl/ecmascript-binding/es-exceptions');
|
||||
|
||||
runner.setFlags(['--expose-internals']);
|
||||
runner.setInitScript(`
|
||||
const { internalBinding } = require('internal/test/binding');
|
||||
const { DOMException } = internalBinding('messaging');
|
||||
Object.defineProperty(global, 'DOMException', {
|
||||
writable: true,
|
||||
configurable: true,
|
||||
value: DOMException,
|
||||
});
|
||||
`);
|
||||
runner.loadLazyGlobals();
|
||||
|
||||
runner.runJsTests();
|
||||
|
Loading…
x
Reference in New Issue
Block a user