Daniel,
I do not think the global object as default this is an error at all, this is
my point.

What does not make sense at all is to use a "this" referred to an undefined
value.

undefined is not an object so "this" which is a self-instance/scope pointer
does not make sense.

This is the most secure way to obtain the original global object and we are
loosing it with "strict"

var originalWindow = (function(){return this})();

so old browser with "strict" code cannot retrieve the native window if it
has been redefined somewhere else.

Do you understand what I mean?

"strict" will mean double test, double behavior, because of compatible and
not compatible browser ... it is truly simple to understand, you resolve
"gotchas" ? Trust me, you gonna create even more gotchas for old browsers in
this way.

Regards


On Fri, Aug 14, 2009 at 12:48 PM, Daniel Friesen
<nadir.seen.f...@gmail.com>wrote:

>
> Strict mode doesn't have new "features", it has restrictions.
> Strict mode adds nothing over what ES3 already has, it only places
> restrictions on things which can cause issues or hinder the ability for
> the engine to optimize.
> this in functions is undefined instead of global, eval cannot
> dynamically inject new variables, eval cannot be renamed or passed
> around in ways that make eval get indirectly called and potentially
> inject code where it doesn't belong, `foo = 123` does not define an
> implied global and throws instead, while a nice feature but widely
> misunderstood while() {} prevents some potential optimizations so it's a
> syntax error in strict mode, there might have been one or two more.
>
> Your code works fine whether it's run in ES3 or ES5. The difference is
> that when testing using an ES5 browser a lot of gotchas like forgetting
> var in front of a variable throw errors instead of silently exhibiting
> confusing behavior. As well any ES5 browser running the code has the
> opportunity to optimize the code and run it faster.
>
> ~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://daniel.friesen.name]
>
> Andrea Giammarchi wrote:
> > Who talked about users here?
> >
> > You put "strict" you do not have that common behavior, whatever right
> > or wrong it is, but you cannot use new features for compatibility reason.
> >
> > Where exactly do you find a better development and debug pattern with
> > this strategy?
> >
> > >
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jQuery Development" group.
To post to this group, send email to jquery-dev@googlegroups.com
To unsubscribe from this group, send email to 
jquery-dev+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to