On 29 January 2013 21:14, Tom Van Cutsem tomvc...@gmail.com wrote:
2013/1/29 Brandon Benvie bran...@brandonbenvie.com
Proxies are the thing that ultimately complicates the object model and
these are fallout from it, but most of us agree that Proxies are worth it.
I think this is a strange
Le 30 janv. 2013 à 06:12, Andrea Giammarchi andrea.giammar...@gmail.com a
écrit :
I have a blog post about it called
Resurrecting The With Statement
and before I post the link, there the long story short:
putting `with(this){` before any build process/inlined library and `}` at the
To enable strict mode, the use strict expression must come as the first
non-statement of a script or function body. That means
function x(){}
use strict;
Will enable strict mode, but
(function x(){});
use strict;
won't. To make your example strict, you'd have to do
with
Correction, the use strict directive needs to appear as the first statement
(ExpressionStatement) that's not an EmptyStatement and not a
FunctionDeclaration. Anything else will cause the directive to be ignored.
On Wed, Jan 30, 2013 at 11:15 AM, Brandon Benvie
bran...@brandonbenvie.comwrote:
let me rephrase ...
putting `with(this){` before any build process/inlined library and `}` at
the end of all concatenated files **nothing** is strict anymore ^_^
function isStrict() {use strict;
return this;
}
isStrict(); // undefined
now, wraping the whole thing inside a with statement
actually, interesting enough, function expressions do not suffer this
problem ... this is getting weirder and weirder ...
with(this){
alert(function isStrict() {use strict;
return this;
}()); // undefined
}
br
On Wed, Jan 30, 2013 at 9:00 AM, Andrea Giammarchi
The behavior of a FunctionDeclaration that's not directly in the body of a
Program or function is not defined in ES5 and this is likely fallout from
that.
___
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss
so the directive is about expressions only ? interesting
On Wed, Jan 30, 2013 at 9:10 AM, Brandon Benvie
bran...@brandonbenvie.comwrote:
The behavior of a FunctionDeclaration that's not directly in the body of a
Program or function is not defined in ES5 and this is likely fallout from
that.
The behavior you showed is very odd indeed, I suspect it's actually a bug.
But I would guess the reason the bug exists is because of it being a
FunctionDeclaration.
On Wed, Jan 30, 2013 at 12:12 PM, Andrea Giammarchi
andrea.giammar...@gmail.com wrote:
so the directive is about expressions
On 30 January 2013 18:00, Andrea Giammarchi andrea.giammar...@gmail.com wrote:
let me rephrase ...
putting `with(this){` before any build process/inlined library and `}` at
the end of all concatenated files **nothing** is strict anymore ^_^
function isStrict() {use strict;
return this;
}
On 30 January 2013 17:19, Brandon Benvie bran...@brandonbenvie.com wrote:
Correction, the use strict directive needs to appear as the first statement
(ExpressionStatement) that's not an EmptyStatement and not a
FunctionDeclaration. Anything else will cause the directive to be ignored.
_Any_
thanks, that makes sense. I have tried this too:
with({}){
function isStrict() {use strict;
return this;
}
alert(isStrict()); // global object
}
still global though, but I believe that a side effect of the with statement.
Weird that expressions behave outside that implicit context.
last examples, for archive reasons:
function isStrict() {use strict;
return this;
}
with(false){
alert(isStrict()); // global object
alert((0, isStrict)()); // undefined
}
mystery solved, still something to be aware for library authors. I'll
explain in a tiny counter post later on.
Le 30 janv. 2013 à 18:00, Andrea Giammarchi andrea.giammar...@gmail.com a
écrit :
let me rephrase ...
putting `with(this){` before any build process/inlined library and `}` at the
end of all concatenated files **nothing** is strict anymore ^_^
function isStrict() {use strict;
return
This came out of disabling use strict; everywhere thread
https://mail.mozilla.org/pipermail/es-discuss/2013-January/028511.html
After a better analysis, I have realized it is possible to simulate the
monocle mustache in ES5 via use strict;
Any thought on this, appreciated.
function With(o) {
2013/1/30 Andreas Rossberg rossb...@google.com
I suppose you mean that proxies aren't supposed to complicate
pre-existing aspects of the object model. Their mere existence of
course is a major complication in itself.
I won't deny that :-) Proxies bring about many interleaving-hazards and
16 matches
Mail list logo