Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Don't set array document fragments as return value.

  • Loading branch information...
commit eb2cbd26b76f6784ecfc2db25c268510bfe547c8 1 parent cc39bac
@kriszyp authored
Showing with 4 additions and 4 deletions.
  1. +3 −3 put.js
  2. +1 −1  test/put.js
View
6 put.js
@@ -52,11 +52,11 @@ define([], forDocument = function(doc, newFragmentFasterHeuristic){
lastSelectorArg = false;
if(argument instanceof Array){
// an array
- returnValue = doc.createDocumentFragment();
+ current = doc.createDocumentFragment();
for(var key = 0; key < argument.length; key++){
- returnValue.appendChild(put(argument[key]));
+ current.appendChild(put(argument[key]));
}
- argument = returnValue;
+ argument = current;
}
if(argument.nodeType){
current = argument;
View
2  test/put.js
@@ -68,7 +68,7 @@ console.assert(checkbox.getAttribute("checked") == "checked");
var div = put("div");
var arrayFrag = put(div, ["span.c1", "span.c2", "span.c3"]);
-console.assert(arrayFrag.nodeType == 11);
+console.assert(arrayFrag.tagName.toLowerCase() == "div");
console.assert(div.firstChild.className == "c1");
console.assert(div.lastChild.className == "c3");
Please sign in to comment.
Something went wrong with that request. Please try again.