> If not, could possibly non-shared state be the default behaviour. And shared 
> state modules - which share state within contexts - are somehow marked as 
> shared at module definition. e.g.
> module ModShared {
> "use shared" // or some mechanism to signify shared state
> ...

IMO, this would be draconian, insufficient on its own for security, and ad hoc.

Sometimes you want global state. Sometimes you want a module that memoizes 
everything. When you decide that you want control over the memoization 
(separate memoization tables, multiple instances of your memoizing data 
structures, etc.), you put the state in functions and/or objects and now it's 
not global anymore. That works well in ES already, and there's no need to 
restrict it.

That said, dialects (e.g. security-oriented dialects) would of course be free 
to provide such restrictions.

Dave

_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to