You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// processSignal expects a global called `signals` -- of course, there can local variable naming conflict on the client, which is why globals were a bad idea.
267
-
g['signals']=newWebSignalsRuntime(signalBuffer)
277
+
constanalytics=newAnalyticsRuntime()
278
+
constsignals=newWebSignalsRuntime(signalBuffer)
279
+
280
+
constoriginalAnalytics=g.analytics
281
+
try{
282
+
if(g['analytics']instanceofAnalyticsRuntime){
283
+
console.warn(
284
+
'Invariant: analytics variable was not properly restored on the previous execution. This indicates a concurrency bug'
285
+
)
268
286
269
-
// expect analytics to be instantiated -- this will conflict in the global scope TODO
270
-
g['analytics']=newAnalyticsRuntime()
287
+
return
288
+
}
271
289
272
-
// another possible namespace conflict?
273
-
// @ts-ignore
274
-
if(typeofprocessSignal!='undefined'){
275
-
g['processSignal'](signalBuffer[0])
276
-
}else{
277
-
console.warn('no processSignal function is defined in the global scope')
290
+
g['analytics']=analytics
291
+
292
+
g['signals']=signals
293
+
processSignal(signal,{
294
+
// we eventually want to get rid of globals and processSignal just uses local variables.
0 commit comments