@@ -82,36 +82,35 @@ export class ExtHostExtensionService extends AbstractExtHostExtensionService {
8282 throw new Error ( `Cannot load module '${ mod } '` ) ;
8383 }
8484
85- const exports = Object . create ( null ) ;
86- patchSelf . module = { exports } ;
87- patchSelf . exports = exports ;
85+ const moduleExportsTrap = { exports : Object . create ( null ) } ;
86+ patchSelf . module = moduleExportsTrap ;
87+ patchSelf . exports = moduleExportsTrap . exports ;
8888
8989 const next = joinPath ( parent , '..' , ensureSuffix ( mod , '.js' ) ) ;
9090 moduleStack . push ( next ) ;
9191 importScripts ( asDomUri ( next ) . toString ( true ) ) ;
9292 moduleStack . pop ( ) ;
9393
94- return exports ;
94+ return moduleExportsTrap . exports ;
9595 } ;
9696
9797 try {
9898 activationTimesBuilder . codeLoadingStart ( ) ;
9999
100- const exports = Object . create ( null ) ;
101- patchSelf . module = { exports } ;
102- patchSelf . exports = exports ;
100+ const moduleExportsTrap = { exports : Object . create ( null ) } ;
101+ patchSelf . module = moduleExportsTrap ;
102+ patchSelf . exports = moduleExportsTrap . exports ;
103103
104104 module = module . with ( { path : ensureSuffix ( module . path , '.js' ) } ) ;
105105 moduleStack . push ( module ) ;
106106
107107 importScripts ( asDomUri ( module ) . toString ( true ) ) ;
108108 moduleStack . pop ( ) ;
109+ return Promise . resolve < T > ( moduleExportsTrap . exports ) ;
109110
110111 } finally {
111112 activationTimesBuilder . codeLoadingStop ( ) ;
112113 }
113-
114- return Promise . resolve < T > ( exports ) ;
115114 }
116115
117116 async $setRemoteEnvironment ( env : { [ key : string ] : string | null } ) : Promise < void > {
0 commit comments