"no strict"; directive

Oliver Hunt oliver at apple.com
Thu Nov 15 12:06:18 PST 2012


On Nov 15, 2012, at 11:59 AM, Andrea Giammarchi <andrea.giammarchi at gmail.com> wrote:

> gotcha about eval ... but indeed eval makes things slower in any case, right?

I wasn't commenting on the performance of eval, i was providing (and I stated this explicitly) a trivial case where the semantics immediately become weird.

wrt performance: Analysis to enforce strict mode restrictions is inherently more expensive than non-strict mode, but the moment you start allowing arbitrary entering an exiting of strict mode you are adding more cost, and for what reason?  

You have given two specific features, neither of which is good, and are willing to take every other misfeature of pre-strict JS in order to get them.  If you want misfeatures that aren't available in strict mode, and are willing to have your code be non-strict, why are you entering strict mode in the first place?

--Oliver

> 
> 
> On Thu, Nov 15, 2012 at 11:58 AM, Andrea Giammarchi <andrea.giammarchi at gmail.com> wrote:
> my typo ... I am NOT talking about callee, I am talking about caller which is NOT a misfeature specially when it comes to debug and stack trace.
> 
> 
> On Thu, Nov 15, 2012 at 11:55 AM, Oliver Hunt <oliver at apple.com> wrote:
> 
> On Nov 15, 2012, at 11:44 AM, Andrea Giammarchi <andrea.giammarchi at gmail.com> wrote:
> 
> > I wonder if there is any plan to allow a chunk of code to disable for its own closure purpose a previously called "use strict"; directive.
> >
> > This is about the ability to use, when not possible otherwise, some good old feature such caller which is impossible to replicate when use strict is in place.
> >
> > I am talking about arguments.callee, I am talking about caller.
> 
> arguments.callee and .caller are not good features.
> 
> Being able to access your caller is a misfeature.
> 
> arguments.callee is simply unnecessary.
> 
> Also having the ability to lose strict semantics at arbitrary locations in the middle of other strict modes makes things even slower, and adds all sorts of weird semantic behaviours (eg. what would eval('"no strict"; var x;') do? -- this is hypothetical, just given as a trivial example of where things go weird)
> 
> --Oliver
> 
> 

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


More information about the es-discuss mailing list