Skip to content

Commit 4ad4d82

Browse files
committed
update sandbox
1 parent 3320592 commit 4ad4d82

File tree

1 file changed

+2
-2
lines changed
  • packages/signals/signals/src/core/processor

1 file changed

+2
-2
lines changed

packages/signals/signals/src/core/processor/sandbox.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,7 @@ const processWithGlobalScopeExecutionEnv = (
292292
'Invariant: analytics variable was not properly restored on the previous execution. This indicates a concurrency bug'
293293
)
294294
}
295+
const originalSignals = g.signals
295296

296297
try {
297298
g['analytics'] = analytics
@@ -309,10 +310,9 @@ const processWithGlobalScopeExecutionEnv = (
309310
} finally {
310311
// restore globals
311312
g['analytics'] = originalAnalytics
313+
g['signals'] = originalSignals
312314
}
313315

314-
// this seems like it could potentially cause bugs in async environment
315-
g.analytics = originalAnalytics
316316
return analytics.getCalls()
317317
}
318318

0 commit comments

Comments
 (0)