Declarations

Michael O'Brien mob at mbedthis.com
Tue Apr 15 11:38:43 PDT 2008


Jon, thanks. Any thoughts on the original post?


>>> Question about declarations:
>>>
>>> Consider:
>>>
>>> print(Shape.x)
>>> public class Shape { public static var x = 1; }
>>> print(Shape.x)
>>>
>>> fun()
>>> function fun() { print("fun"); }
>>>
>>>
>>> In the RI this prints:
>>>
>>> undefined
>>> 1
>>> fun
>>>
>>> In ASC this prints:
>>> 1
>>> 1
>>> fun
>>>
>>> What happens in the RI is the class declaration seems to occur where
>>> it is coded. It is not being
>>> hoisted to the top of the enclosing var block. Whereas the function
>>> declaration is and thus can
>>> be called before its declaration.
>>>
>>> Is this an RI bug or just a divergence from AS3?
>>>
>>> Michael
>>
>> _______________________________________________
>> Es4-discuss mailing list
>> Es4-discuss at mozilla.org
>> https://mail.mozilla.org/listinfo/es4-discuss
>>
>>




More information about the Es4-discuss mailing list