Hi, sorry if this is tangentially related to the conversation, however I've
just got a simple question. How would you call eval() with the ThisBinding
inside the evaluated code being a custom item? In ES5 we'd do something
like the following:
(function () {
eval(foo);
}).call(bar);
Would this change significantly with the advent of arrow functions and hard
lexical binding or am I not getting my head around how these are supposed
to be applied?
On 21 June 2013 04:06, Quildreen Motta <[email protected]> wrote:
>
> On 1 June 2013 20:52, Jorge <[email protected]> wrote:
>
>> On 02/06/2013, at 01:22, Brandon Benvie wrote:
>> > On 6/1/2013 3:44 PM, Jorge wrote:
>> {
>> block: {
>> if (true) {
>> break block;
>> }
>> }
>> }
>>
>> But then... I'm not sure this is any better than an IIFE!
>>
>>
> Anything is better than an "Immediately Invoked
> Function-silly-Expression", actually. The only reasonable use for that is
> to create a new scope in the context of a statement:
>
> void function() {
> doSomething()
> }()
>
> Block scoping/let makes this pattern completely unecessary. As for the
> other arguments, you do not wrap a function expression in parenthesis,
> they're already expressions so there's no need for that. At any rate, the
> problem here is JavaScript's usage of statements instead of Expressions,
> Expressions Everywhere.
>
> e.g.:
>
> var x = function(){ return foo }()
>
>
>
>
> --
> --
> Quildreen "Sorella" Motta (http://killdream.github.com/)
> *— JavaScript Alchemist / Minimalist Designer / PLT hobbyist —*
>
> _______________________________________________
> es-discuss mailing list
> [email protected]
> https://mail.mozilla.org/listinfo/es-discuss
>
>
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss