Module isolation

Brendan Eich brendan at mozilla.com
Mon Jan 11 17:04:51 PST 2010


On Jan 11, 2010, at 10:53 AM, David-Sarah Hopwood wrote:

>> Who said primordial objects are shared between modules?
>
> Having separate copies of primordial objects for each module is not
> sufficient to ensure isolation. If one module has access to some  
> object
> obj of another, it can also get access to that object's prototype  
> chain
> using Object.getPrototypeOf(obj), or obj.constructor.prototype.

I meant what I wrote: [w]ho said primordial objects are shared between  
modules? Shared by passing objects, or by fiat in the implementation,  
does not matter. Isolation does not require frozen primordials, no  
matter how often you assume it does to conclude that it does.

Adam Barth's system of isolated heaps is similar to some of Mozilla's  
wrappers, which can be used to isolate effects as well as propagate  
them. Wrappers or membranes are another way than frozen primordials to  
isolate.

Your assertion that isolation requires frozen primordials is simply  
not true in general, but of course it is if you assume it for some  
particular reason that is a choice among several design alternatives.  
Better to argue why your preferred alternative is better, than to  
assert that it is the only way to isolate.

/be


More information about the es-discuss mailing list