I noted some open issues on "Classes with Trait Composition"
brendan at mozilla.com
Tue May 24 07:00:40 PDT 2011
On May 24, 2011, at 6:20 AM, Andreas Rossberg wrote:
> - Treat projection from a module M (which we can distinguish
> statically) specially. If we project a yet unclosed function:
> * if it's called right away, pass M.Env as the environment,
> * if it's not called, allocate a proper closure for it with environment M.Env,
This is already done by SpiderMonkey and I believe other engines, with function expressions in certain contexts.
Not to rain on the module function parade (I'm leaning away from classes, in search of simpler solutions that compose well, so I have a soft spot for it), but reifying the module as an object with its exports as properties means those properties are non-configurable and non-writable. That goes against the classes-as-sugar-for-prototypal-objects goal. The -prototypal part is missing too.
More information about the es-discuss