File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -292,7 +292,7 @@ function isAllowedOrigin(
292292
293293export function expose (
294294 obj : any ,
295- ep : Endpoint = self as any ,
295+ ep : Endpoint = globalThis as any ,
296296 allowedOrigins : ( string | RegExp ) [ ] = [ "*" ]
297297) {
298298 ep . addEventListener ( "message" , function callback ( ev : MessageEvent ) {
@@ -422,7 +422,7 @@ declare var FinalizationRegistry: FinalizationRegistry<Endpoint>;
422422
423423const proxyCounter = new WeakMap < Endpoint , number > ( ) ;
424424const proxyFinalizers =
425- "FinalizationRegistry" in self &&
425+ "FinalizationRegistry" in globalThis &&
426426 new FinalizationRegistry ( ( ep : Endpoint ) => {
427427 const newCount = ( proxyCounter . get ( ep ) || 0 ) - 1 ;
428428 proxyCounter . set ( ep , newCount ) ;
@@ -550,7 +550,7 @@ export function proxy<T extends {}>(obj: T): T & ProxyMarked {
550550
551551export function windowEndpoint (
552552 w : PostMessageWithOrigin ,
553- context : EventSource = self ,
553+ context : EventSource = globalThis ,
554554 targetOrigin = "*"
555555) : Endpoint {
556556 return {
You can’t perform that action at this time.
0 commit comments