File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -141,7 +141,7 @@ export class WindowsScriptingHost extends EventEmitter {
141141 if ( existingProxy )
142142 return existingProxy ;
143143
144- const target = handler === this . #objectHandler? new RemoteObject ( ref ) : function ( ) { } ;
144+ const target = handler === this . #objectHandler? new RemoteObject ( ref ) : new RemoteFunction ( ref ) ;
145145 const newProxy = new Proxy ( target , handler ) ;
146146 target . proxy = newProxy ;
147147 this . #ref2proxy. set ( ref , new WeakRef ( newProxy ) ) ; // may be overwriting a dead WeakRef
@@ -269,3 +269,25 @@ class RemoteObject {
269269 this . #proxy = proxy ;
270270 }
271271}
272+
273+ class RemoteFunction extends Function {
274+
275+ #ref;
276+ #proxy;
277+
278+ constructor ( ref ) {
279+ this . #ref = ref ;
280+ }
281+
282+ get ref ( ) {
283+ return this . #ref;
284+ }
285+
286+ get proxy ( ) {
287+ return this . #proxy;
288+ }
289+
290+ set proxy ( proxy ) {
291+ this . #proxy = proxy ;
292+ }
293+ }
You can’t perform that action at this time.
0 commit comments