Problem with initialization order (Flash)

31 views
Skip to first unread message

T1m_

unread,
Mar 12, 2015, 6:48:47 AM3/12/15
to haxe...@googlegroups.com
Code here http://try.haxe.org/#5a559

For js output is
20:35:13:037   prop from Ext before all is: undefined
20:35:13:037   prop from Ext after init() is: 10
20:35:13:037   prop from Ext after super() is: 10

but for Flash last output is NaN.

It is a Haxe issue or Flash works exactly as expected?

Andre Lacasse

unread,
Mar 12, 2015, 12:54:13 PM3/12/15
to haxe...@googlegroups.com
The call to super in Haxe probably initialize the class member to a default value, in this case NaN. The same code in AS3 give correct result. You normally call super() before everything in my opinion.
Reply all
Reply to author
Forward
0 new messages