[Groonga-commit] groonga/gcs [master] Clone root element correctly

Back to archive index

null+****@clear***** null+****@clear*****
2012年 7月 26日 (木) 16:58:17 JST


SHIMODA Hiroshi	2012-07-26 16:58:17 +0900 (Thu, 26 Jul 2012)

  New Revision: e602594d7fd90dc9b5472c290f39e9fd983bc44d
  https://github.com/groonga/gcs/commit/e602594d7fd90dc9b5472c290f39e9fd983bc44d

  Log:
    Clone root element correctly

  Modified files:
    lib/xmlbuilder.js

  Modified: lib/xmlbuilder.js (+5 -3)
===================================================================
--- lib/xmlbuilder.js    2012-07-26 16:56:50 +0900 (0425e98)
+++ lib/xmlbuilder.js    2012-07-26 16:58:17 +0900 (e6c4a13)
@@ -15,9 +15,11 @@ XMLFragment.prototype.fragment = function(fragments) {
 };
 
 XMLFragment.prototype.importXMLBuilder = function(xmlbuilder) {
-  var fragment = xmlbuilder.clone(true).root;
-  fragment.parent = this;
-  this.children.push(fragment);
+  var root = xmlbuilder.children[xmlbuilder.children.length-1];
+  var clonedRoot = root.clone(true);
+  clonedRoot.parent = this;
+  this.children.push(clonedRoot);
+  clonedRoot.isRoot = false;
   return this;
 };
 
-------------- next part --------------
HTML$B$NE:IU%U%!%$%k$rJ]4I$7$^$7$?(B...
Descargar 



Groonga-commit メーリングリストの案内
Back to archive index