MXMLClassReferenceNodeBase: detect MXML 2006 declarations and add them to implicit MXMLDeclarationsNodes in the AST (references #243)

<fx:Declarations> doesn't exist in MXML 2006. Instead, declarations are direct children of the root. This is a little quirky. If the root is an mx.core.IContainer, and the child implements mx.core.IUIComponent, then it isn't considered a Declaration. Otherwise, for non-container roots, or children that aren't UI components, then they are declarations.

I could have added the declarations directly to the root (they were being incorrectly including in the default property), but then the SWF and JS emitters would also need to detect MXML 2006, and it all got pretty messy. Instead, the implicit MXMLDeclarationsNode makes the emitters detect declarations the same as MXML 2009.
4 files changed