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
It is trivial to create modules with internal state.
Script modules can be garbage collected when they are unreferenced by the
calling environment. They will be transparently reloaded on next use.
However, this can create a visible error condition.
This problem does not affect native-language module which correctly implement
the *_FiniModule() interface, as this interface tells the garbage collector
that we have internal state.
Work around: Create a GC root in script for any modules which hide internal
state, e.g.
const msgex = require("msgex");
Suggested Fix: We need to turn this functionality off by default for script
modules, and only enable it for modules that explicitly notify GPSEE that they
can be garbage collected. Suggested interface: 'module.pure = true' (purity
concept borrowed from gcc function attributes)
Original issue reported on code.google.com by wes@page.ca on 27 Jan 2012 at 7:55
The text was updated successfully, but these errors were encountered:
We also need to be able to set 'module.pure = true' from the loader if we are
working in a conceptual sandbox that should be reloadable and garbage collected.
Original comment by christ...@christophdorn.com on 27 Jan 2012 at 9:12
Original issue reported on code.google.com by
wes@page.ca
on 27 Jan 2012 at 7:55The text was updated successfully, but these errors were encountered: