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
This means through the lifecycle of the process w in Zepto will refer to a local copy of that instance of window. This is problematic when using benv.teardown(true) b/c it will delete the global instances of window and the next benv.setup will create a new window + DOM environment. Meanwhile our view is still holding on to a cached require('zepto') which is holding on to that old instance of window in w.
There are two options to solve this problem 1. Be diligent in setting up and tearing down a clean DOM by clearing out require caches until the code is always re-setting var w = window 2. Let benv hold on to one instance of the DOM per process and let the programmer deal with setup/teardown of mutating global DOM state. We are choosing the latter because the former has proven even more tedious of a black box to understand (e.g. when to require/rewire/clear cached modules/etc.) whereas the latter is more obvious and closer to what one would be dealing with in typical browser testing.
Too many libraries caching references to DOM globals... probably best to make this default.
The text was updated successfully, but these errors were encountered: