aboutsummaryrefslogtreecommitdiffstats
path: root/src/selector.js
diff options
context:
space:
mode:
authorJohn Resig <jeresig@gmail.com>2009-07-23 13:22:55 +0000
committerJohn Resig <jeresig@gmail.com>2009-07-23 13:22:55 +0000
commit0a6c5205d21c29485ff8338881825135b6d9f373 (patch)
tree45da5d28f864960b11d3cc4e07eb5f450a0c7322 /src/selector.js
parentb964e56946c9111d7e53fa1eafb14cab3cd642f2 (diff)
downloadjquery-0a6c5205d21c29485ff8338881825135b6d9f373.tar.gz
jquery-0a6c5205d21c29485ff8338881825135b6d9f373.zip
Make sure that at least one argument is provided to .slice(), in accordance with the spec. Fixes jQuery bug #4942.
Diffstat (limited to 'src/selector.js')
-rw-r--r--src/selector.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/selector.js b/src/selector.js
index c6fc0255a..fb332465d 100644
--- a/src/selector.js
+++ b/src/selector.js
@@ -661,7 +661,7 @@ for ( var type in Expr.match ) {
}
var makeArray = function(array, results) {
- array = Array.prototype.slice.call( array );
+ array = Array.prototype.slice.call( array, 0 );
if ( results ) {
results.push.apply( results, array );
@@ -674,7 +674,7 @@ var makeArray = function(array, results) {
// Perform a simple check to determine if the browser is capable of
// converting a NodeList to an array using builtin methods.
try {
- Array.prototype.slice.call( document.documentElement.childNodes );
+ Array.prototype.slice.call( document.documentElement.childNodes, 0 );
// Provide a fallback method if it does not work
} catch(e){