Permalink
Browse files

Merge branch 'master' of github.com:cgiffard/Vixen

  • Loading branch information...
cgiffard committed Dec 5, 2012
2 parents 364942b + af13ab8 commit 4646a343521d22712cbb225c7f6adc8b402458fe
Showing with 7 additions and 3 deletions.
  1. +7 −3 vixen.js
View
@@ -1405,7 +1405,7 @@ setTimeout:true, clearTimeout:true, captionator:true */
if (!media)
throw new Error("Requested media object not found.");
- if (typeof media === "array")
+ if (typeof media === "array" || media instanceof Array)
return media;
if (media instanceof Vixen)
@@ -1446,7 +1446,11 @@ setTimeout:true, clearTimeout:true, captionator:true */
return selector;
} else {
- if (typeof selector === "array") {
+
+ if (selector instanceof NodeList)
+ selector = [].slice.call(selector);
+
+ if (typeof selector === "array" || selector instanceof Array) {
result = selector.map(Vixen.ify);
} else if (typeof selector == "string") {
@@ -1458,7 +1462,7 @@ setTimeout:true, clearTimeout:true, captionator:true */
result = Vixen.get("video");
}
- if (result.length === 1)
+ if (result && typeof result === "array" && result.length === 1)
return result[0];
return result;

0 comments on commit 4646a34

Please sign in to comment.