Tucker, what is the reason that methods cannot be added at runtime any more?
On Tue, Jan 25, 2011 at 1:43 AM, P T Withington <[email protected]> wrote: > [Did your debugger not warn you to install the Flash Debug player? It's a > bug if it did now. > > If you had the Debug player, you would have gotten a slightly more useful > error message: > > > ERROR @phil.lzx#10: ReferenceError: Error #1070: Method draw not found on > LzView > > drawmixin1.draw init > > myclass.draw init > > ] > > Ok, this is because of the dynamic nature of LZX. In the past, you _could_ > add a draw method to lz.view at runtime, which is why no one complains, > including the normally strict Flex compiler. > > But, we have new rules now, that say you no longer can add methods at > runtime (but unfortunately, we still let you add other things, so we can't > ask Flex to be that strict, yet). > > Could you file an improvement to detect this at runtime? It should be > pretty easy to do once Don has the class models working. The compiler > already has most of the information it needs to make this check, since it > already has to auto-compute when an LZX method needs `override`, it just > needs to complain if it sees a super() call without an override. > > In the mean time, the mixin user needs to either be an expert, or wear > safety glasses and steel-toed shoes. > > On 2011-01-24, at 19:26, [email protected] wrote: > > > > > > >> Also as I say in the wiki page, and I hope what I said is true, your > second example should fail to compile in the swf10 runtime. The Flex > compiler should notice that you are calling a non-existent super method at > compile time, and complain. > > > > There isn't a compile time error; just a runtime error. > > > > ERROR @c3.lzx≈10: ReferenceError: Error #1070 > > drawmixin1.draw init > > myclass.draw init > > > > > > The HTML5 compile has a better error message: > > > > ERROR: super.draw is undefined in draw > > drawmixin2.draw init > > drawmixin1.draw init > > myclass.draw init > > >
