Dynamic Modules Questions

David Bruant bruant.d at gmail.com
Thu Mar 7 04:50:51 PST 2013


Le 07/03/2013 13:19, Sam Tobin-Hochstadt a écrit :
>
> On Mar 7, 2013 4:53 AM, "David Bruant" <bruant.d at gmail.com 
> <mailto:bruant.d at gmail.com>> wrote:
> >
> > Le 06/03/2013 23:31, Sam Tobin-Hochstadt a écrit :
> >
> >> On Wed, Mar 6, 2013 at 9:46 AM, Kevin Smith <khs4473 at gmail.com 
> <mailto:khs4473 at gmail.com>> wrote:
> >>>
> >>> (Referencing the module loaders proposal at
> >>> http://wiki.ecmascript.org/doku.php?id=harmony:module_loaders)
> >>>
> >>> 1)  Loaders have a "strict" flag which indicates whether code 
> evaluated in
> >>> the Loader's context should be implicitly strict.  If modules 
> themselves are
> >>> implicitly strict, is this flag superfluous?
> >>
> >> myLoader.eval(someJS) is just like regular `eval`, and also loaders
> >> handle `eval` called from inside them.  So no, the flag isn't
> >> superfluous.
> >
> > I fail to understand the benefit of forcing the mode of the loaded code.
> > There is a risk to break the loaded code by forcing a mode it might 
> not have been written for.
>
> Then you probably won't want to use this option when constructing 
> loaders.  Others, I'm sure, feel differently.
>
I would most certainly use the option if I understood what use case it 
covers and found myself in the relevant situation.
What's the use case?
Out of curiosity, are there existing loaders libraries providing this 
feature too?

What is the semantics of setting strict:false?

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20130307/d1b3b9a3/attachment.html>


More information about the es-discuss mailing list