Sharing objects across modules (was: VirtualHandler fundamental traps default values)

Tom Van Cutsem at
Tue Sep 11 12:44:37 PDT 2012

2012/9/11 David Bruant <bruant.d at>

> Le 11/09/2012 21:14, Tom Van Cutsem a écrit :
> > (...)
> > Note that in ES6, Reflect should probably be represented as a module
> > instance, not as a global object. So then Handler.prototype would
> > inherit from a module instance object. I don't see anything
> > necessarily wrong with that, but I just want to point it out.
> Is there a value to instanciate the Reflect module several times? So
> far, it's only made of stateless methods, it would save memory to have
> only one Reflect object in my opinion.

The Reflect module is indeed stateless. And IIRC, module instances would be
frozen anyway.

I don't know the exact rules of module instance objects. Is it possible to
reify the same module as multiple distinct instance objects in the same
module loader context, or does the loader context cache a single instance
object per module?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list