"no strict"; directive
andrea.giammarchi at gmail.com
Thu Nov 15 12:17:51 PST 2012
the debugger you mention is most likely using the with statement ...
Can we just stick with the answer if it is planned or not? I don't want to
convince you that there are cases where non strict features are needed ...
it is just like that and many times already discussed.
The eval is a non issue, the script cannot be evaluated in any case ... an
eval('"use strict"') is a destructive non sense regardless and it should
simply throw an error. A Function('"use strict";') is another story.
I have never mentioned arguments, neither caller, which would be part of
arguments.callee and not arguments itself.
I can name function expressions, I always do, and the "no strict" is needed
for more than a case.
Again, is there any real reason to not consider a "no strict" directive?
The whole web is running no strict thanks to minifiers so I really would
like to listen to real reasons over already discussed academic debates.
On Thu, Nov 15, 2012 at 12:10 PM, Oliver Hunt <oliver at apple.com> wrote:
> On 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.
> The solution to debugging is to use a debugger, not to try and debug from
> within the language.
> All modern JS engines provide a) a debugger and b) stack traces on
> Even if they weren't .caller is insufficient: it can't walk over strict,
> native, or global code that exists in the call stack, so at best you only
> get a crappy result.
> Like I said in my prior email: If you're willing to toss out the
> improvements of strict mode just to get arguments.caller, you may as well
> stop using it in the first place.
> 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)
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the es-discuss