flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ha...@apache.org
Subject git commit: [flex-asjs] [refs/heads/develop] - Fixed moving child xml between parents
Date Wed, 06 Sep 2017 07:56:27 GMT
Repository: flex-asjs
Updated Branches:
  refs/heads/develop 6000f360d -> f92aba37f


Fixed moving child xml between parents


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/f92aba37
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/f92aba37
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/f92aba37

Branch: refs/heads/develop
Commit: f92aba37f7ba9435cb6929dab61a7c85dfa65d0a
Parents: 6000f36
Author: Harbs <harbs@in-tools.com>
Authored: Wed Sep 6 10:56:23 2017 +0300
Committer: Harbs <harbs@in-tools.com>
Committed: Wed Sep 6 10:56:23 2017 +0300

----------------------------------------------------------------------
 frameworks/projects/XML/src/main/flex/XML.as |  3 +--
 manualtests/XMLTest/src/MyInitialView.mxml   | 12 +++++++++++-
 2 files changed, 12 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f92aba37/frameworks/projects/XML/src/main/flex/XML.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/XML/src/main/flex/XML.as b/frameworks/projects/XML/src/main/flex/XML.as
index 7e749fc..fff4cfa 100644
--- a/frameworks/projects/XML/src/main/flex/XML.as
+++ b/frameworks/projects/XML/src/main/flex/XML.as
@@ -2121,10 +2121,9 @@ package
 			if(parent == _parent)
 				return;
 			var oldParent:XML = _parent;
-			_parent = parent;
-			//assign first to prevent the possiblity of a recursive loop
 			if(oldParent)
 				oldParent.removeChild(this);
+			_parent = parent;
 		}
 
 		public function setValue(value:String):void

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f92aba37/manualtests/XMLTest/src/MyInitialView.mxml
----------------------------------------------------------------------
diff --git a/manualtests/XMLTest/src/MyInitialView.mxml b/manualtests/XMLTest/src/MyInitialView.mxml
index 851aeac..6746727 100644
--- a/manualtests/XMLTest/src/MyInitialView.mxml
+++ b/manualtests/XMLTest/src/MyInitialView.mxml
@@ -122,6 +122,16 @@ limitations under the License.
         trace(pop.toString());
         trace(xml1.toString());
         
+        var parent:XML = <parent/>;
+        var childXML:XML = <child/>;
+        parent.appendChild(childXML);
+        trace(childXML.toXMLString() + " is child of" + parent.toXMLString() + "? " + (childXML.parent()
== parent));
+        var newParent:XML = <newparent/>;
+        newParent.appendChild(childXML);
+        trace("moving to <newparent/>");
+        trace(childXML.toXMLString() + " is child of" + parent.toXMLString() + "? " + (childXML.parent()
== parent));
+        trace(childXML.toXMLString() + " is child of" + newParent.toXMLString() + "? " +
(childXML.parent() == newParent));
+
         
         var xmlString:String = xml.toXMLString();
         var script:XML = xml..script[0].children()[0];
@@ -266,4 +276,4 @@ limitations under the License.
 		<js:TextButton text="Test" click="runTest()" />
 	</js:Container>
 	
-</js:View>
+</js:View>
\ No newline at end of file


Mime
View raw message