robotlegs / robotlegs-framework

An ActionScript 3 application framework for Flash and Flex
https://robotlegs.tenderapp.com/
MIT License
967 stars 261 forks source link

ASC 2 Compiling.. #154

Closed jamieowen closed 9 years ago

jamieowen commented 11 years ago

Has this been tested with the ASC 2.0 compiler in FB 4.7?

I keep getting errors with casting to IEventDispatcher..

darscan commented 11 years ago

Hello. You can't compile the source with ASC2, you have to use the SWC. Please see: https://github.com/robotlegs/robotlegs-framework/issues/111

Anyone is welcome to submit a pull request with all the conversions (work-arounds) needed to compile with ASC2, but I won't do it myself (the changes make me too sad!).

jamieowen commented 11 years ago

Ok nice one.. Cheers for the quick reply..

darscan commented 11 years ago

BTW, if the ASC2 compiler would catch all the problems, then I would have no problem doing this myself. The real issue is that some problems only unfold at runtime. In theory our unit tests would be able to catch those, but the test are written using FlexUnit.. which can not be compiled using ASC2 as far as I know. At some point I'll give this another try, but it's currently error-prone, requires large effort, and provides little benefit.

jamieowen commented 11 years ago

Ah shit.. Yeah checked that other thread.. seems like it's a bit of a nightmare ( and sad! ) to change things.. Has the SWC worked fine as far as you know?

darscan commented 11 years ago

The SWC should work perfectly. It is compiled using the legacy compiler and thus produces the correct bytecode for the player.

ASC2 generates different bytecode from the legacy compiler.. which is why, when compiling the RL2 source, and fixing the compile-time errors, we still end up with some runtime errors.

jamieowen commented 11 years ago

Actually something good seems to be happening with Air 3.8 Beta in comparison to Air 3.4. I can compile from source with no casting problems so far..

Not sure if it will be the same on Air 3.7.. but i checked the contents of the sdk/frameworks/libs folder and there is a core.swc file included now. That may contain EventDispatcher classes if that was the root of casting problems? ( it's also in 3.7 )

darscan commented 11 years ago

Heh, cool - that was roughly my plan.. to just wait it out. Many of the issues looked like bugs to me. We may end up having to change guarded assignments (x ||= 5), but I'm OK with that.