Fix cascading on array-based declarations
authorRichard Fairhurst <richard@systemeD.net>
Mon, 3 Oct 2011 11:43:41 +0000 (12:43 +0100)
committerRichard Fairhurst <richard@systemeD.net>
Mon, 3 Oct 2011 11:43:41 +0000 (12:43 +0100)
net/systemeD/halcyon/styleparser/Style.as

index 3397936..7ee5b00 100644 (file)
@@ -52,7 +52,8 @@ package net.systemeD.halcyon.styleparser {
                /** Merge two Style objects. */
                public function mergeWith(additional:Style):void {
                        for each (var prop:String in properties) {
-                               if (additional[prop]) {
+                               // Note extra check for empty arrays, which we use to mean 'undefined' (see setPropertyFromString below)
+                               if (additional[prop] && !((additional[prop] is Array) && additional[prop].length==0)) {
                                        this[prop]=additional[prop];
                                }
                        }