use Array::slice

This commit is contained in:
James Campos 2011-05-07 18:49:51 -07:00
parent c4471931dc
commit f056ceba86
2 changed files with 3 additions and 8 deletions

View File

@ -433,17 +433,12 @@
}); });
} }
$$ = function(selector, root) { $$ = function(selector, root) {
var node, result, _i, _len, _results; var result;
if (root == null) { if (root == null) {
root = d.body; root = d.body;
} }
result = root.querySelectorAll(selector); result = root.querySelectorAll(selector);
_results = []; return Array.prototype.slice.call(result);
for (_i = 0, _len = result.length; _i < _len; _i++) {
node = result[_i];
_results.push(node);
}
return _results;
}; };
expandComment = { expandComment = {
init: function() { init: function() {

View File

@ -299,7 +299,7 @@ else
$$ = (selector, root=d.body) -> $$ = (selector, root=d.body) ->
result = root.querySelectorAll selector result = root.querySelectorAll selector
node for node in result Array::slice.call result
#funks #funks
expandComment = expandComment =