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
I suspect closures are being created as a side effect of my {Module}.create(...) pattern, because in at least one place the object returned is referencing variables created in the scope of the object creation function; if the object is deleted, the scope probably will not be destroyed because it actually belongs to the module itself, and so will probably remain in memory.
// DO thisfunctioncreate(){returnnew(functionModuleObject(){varself=this;self.x=5;self.add=function(){self.x++;}})();}// DON'T do thisfunctioncreate(){varx=5;varmodule_object={x: x}module_object.add=function(){module_object.x++;}returnmodule_object;}
The text was updated successfully, but these errors were encountered:
I suspect closures are being created as a side effect of my {Module}.create(...) pattern, because in at least one place the object returned is referencing variables created in the scope of the object creation function; if the object is deleted, the scope probably will not be destroyed because it actually belongs to the module itself, and so will probably remain in memory.
The text was updated successfully, but these errors were encountered: