Ingvar von Schoultz wrote:
> Richard Cornford wrote:
<snip>
>> {
>>    1,2,3,4,5
>> }
>> 
>> - is a valid ES 3 Program (even if a pointless one); A Block
>> statement containing an Expression statement (with automatic
>> semi-colon insertion making the Expression statement
>> into - 1,2,3,4,5; -).
>> 
>> eval('{1,2,3,4,5}') - results in the value 5, while -
>> eval('[1,2,3,4,5]') - returns a 5 element array.
> 
> Yes. And if the rules for "{" remain unchanged, and "[" starts
> out assuming it's a literal, you get the same result with my rules.

And if I wanted that block scope this -

eval("{[\n eval('var a = 1'),eval('var b = 2'),eval('a + b')\n]}");

- will still give me an array (and side effects in the containing scope)?
_______________________________________________
Es4-discuss mailing list
Es4-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es4-discuss

Reply via email to