@@ -78,34 +78,6 @@ function prepareWorkerThreadExecution() {
7878 } ) ;
7979}
8080
81- function prepareShadowRealmExecution ( ) {
82- // Patch the process object with legacy properties and normalizations.
83- // Do not expand argv1 as it is not available in ShadowRealm.
84- patchProcessObject ( false ) ;
85- setupDebugEnv ( ) ;
86-
87- // Preload modules are not supported in ShadowRealm.
88- initializeModuleLoaders ( { shouldPreloadModules : false } ) ;
89- const {
90- privateSymbols : {
91- host_defined_option_symbol,
92- } ,
93- } = internalBinding ( 'util' ) ;
94- const {
95- vm_dynamic_import_default_internal,
96- } = internalBinding ( 'symbols' ) ;
97-
98- // For ShadowRealm.prototype.importValue(), the referrer name is
99- // always null, so the native ImportModuleDynamically() callback would
100- // always fallback to look up the host-defined option from the
101- // global object using host_defined_option_symbol. Using
102- // vm_dynamic_import_default_internal as the host-defined option
103- // instructs the JS-land importModuleDynamicallyCallback() to
104- // proxy the request to defaultImportModuleDynamically().
105- globalThis [ host_defined_option_symbol ] =
106- vm_dynamic_import_default_internal ;
107- }
108-
10981function prepareExecution ( options ) {
11082 const { expandArgv1, initializeModules, isMainThread, shouldPreloadModules } = options ;
11183
@@ -339,7 +311,6 @@ function initializeModuleLoaders(options) {
339311 if ( getEmbedderOptions ( ) . hasEmbedderPreload ) {
340312 runEmbedderPreload ( ) ;
341313 }
342- // Preload modules are not supported in ShadowRealm.
343314 if ( shouldPreloadModules ) {
344315 loadPreloadModules ( ) ;
345316 }
@@ -880,7 +851,6 @@ module.exports = {
880851 initializeModuleLoaders,
881852 prepareMainThreadExecution,
882853 prepareWorkerThreadExecution,
883- prepareShadowRealmExecution,
884854 prepareTestRunnerMainExecution,
885855 markBootstrapComplete,
886856 loadPreloadModules,
0 commit comments