You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by ha...@apache.org on 2016/04/11 10:24:41 UTC

git commit: [flex-asjs] [refs/heads/develop] - More XML

Repository: flex-asjs
Updated Branches:
  refs/heads/develop d4bce998c -> 9d44fa95a


More XML


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

Branch: refs/heads/develop
Commit: 9d44fa95a1c4e6a2bd64492895f15ef0af195af4
Parents: d4bce99
Author: Harbs <ha...@in-tools.com>
Authored: Mon Apr 11 11:24:36 2016 +0300
Committer: Harbs <ha...@in-tools.com>
Committed: Mon Apr 11 11:24:36 2016 +0300

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


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/9d44fa95/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 288fa35..9b9c475 100644
--- a/frameworks/projects/XML/src/main/flex/XML.as
+++ b/frameworks/projects/XML/src/main/flex/XML.as
@@ -270,11 +270,11 @@ package
 		static public function defaultSettings():Object
 		{
 			return {
-			    "ignoreComments" : true,
-			    "ignoreProcessingInstructions" : true,
-			    "ignoreWhitespace" : true,
-			    "prettyIndent" : 2,
-			    "prettyPrinting" : true
+			    ignoreComments : true,
+			    ignoreProcessingInstructions : true,
+			    ignoreWhitespace : true,
+			    prettyIndent : 2,
+			    prettyPrinting : true
 			}
 		}
 		
@@ -306,11 +306,11 @@ package
 		static public function settings():Object
 		{
 			return {
-			    "ignoreComments" : ignoreComments,
-			    "ignoreProcessingInstructions" : ignoreProcessingInstructions,
-			    "ignoreWhitespace" : ignoreWhitespace,
-			    "prettyIndent" : prettyIndent,
-			    "prettyPrinting" : prettyPrinting
+			    ignoreComments : ignoreComments,
+			    ignoreProcessingInstructions : ignoreProcessingInstructions,
+			    ignoreWhitespace : ignoreWhitespace,
+			    prettyIndent : prettyIndent,
+			    prettyPrinting : prettyPrinting
 			}
 		}
 
@@ -1672,8 +1672,8 @@ package
 					throw new TypeError("cannot assign parent xml as child");
 				v.setParent(this);
 				if(_children[idx])
-					_children[idx].setParent(null);
-				_children[idx] = v;
+					removeChild(_children[idx]);
+				insertChildAt(v,idx);
 			}
 			else if(v is XMLList)
 			{
@@ -1999,11 +1999,13 @@ package
 		COMPILE::JS
 		public function setParent(parent:XML):void
 		{
+			if(parent == _parent)
+				return;
 			var oldParent:XML = _parent;
 			_parent = parent;
 			//assign first to prevent the possiblity of a recursive loop
 			if(oldParent)
-				_parent.removeChild(this);
+				oldParent.removeChild(this);
 		}
 
 		public function setValue(value:String):void

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/9d44fa95/frameworks/projects/XML/src/main/flex/XMLList.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/XML/src/main/flex/XMLList.as b/frameworks/projects/XML/src/main/flex/XMLList.as
index 0f4b2ab..cb38a4b 100644
--- a/frameworks/projects/XML/src/main/flex/XMLList.as
+++ b/frameworks/projects/XML/src/main/flex/XMLList.as
@@ -557,7 +557,7 @@ package
 			var childToReplace:XML = _xmlArray[idx];
 			if(childToReplace && _targetObject)
 			{
-				_targetObject.replaceChildAt(childToReplace.childIndex,child);
+				_targetObject.replaceChildAt(childToReplace.childIndex(),child);
 			}
 			if(child is XML)
 			{

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/9d44fa95/manualtests/XMLTest/src/MyInitialView.mxml
----------------------------------------------------------------------
diff --git a/manualtests/XMLTest/src/MyInitialView.mxml b/manualtests/XMLTest/src/MyInitialView.mxml
index 6451996..cf9f677 100644
--- a/manualtests/XMLTest/src/MyInitialView.mxml
+++ b/manualtests/XMLTest/src/MyInitialView.mxml
@@ -52,12 +52,15 @@ limitations under the License.
                 trace("baz: " + xml1.@baz.toString() + " //true");
                 var child:XML = <pop><child name="Sam"/></pop>;
                 xml1.appendChild(child);
-                child = new XML('<pop><child name="George"/></pop>');
+                child = <pop><child name="George"/></pop>;
                 xml1.appendChild(child);
                 trace(xml1.pop[0].toString());
                 trace(xml1.pop[1].toString());
                 var pop:XMLList = xml1.pop;
-                pop[pop.length()] = new XML('<pop><child name="Fred"/></pop>');
+                pop[pop.length()] = <pop><child name="Fred"/></pop>;
+                trace(pop.toString());
+                trace(xml1.toString());
+                pop[0] = <pop><child name="Fred"/></pop>;
                 trace(pop.toString());
                 trace(xml1.toString());
             }