aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit
diff options
context:
space:
mode:
authorDave Methvin <dave.methvin@gmail.com>2011-08-25 12:22:47 -0700
committerDave Methvin <dave.methvin@gmail.com>2011-08-25 12:22:47 -0700
commita839af034db2bd934e4d4fa6758a3fed8de74174 (patch)
tree1a3456c5115e55d3599d182028c0a614acdbb0ec /test/unit
parentf4811bfb04206b9d9c120001603eadb1b529c271 (diff)
parent190136cf6132620327a86274fb108fabf55a1d4f (diff)
downloadjquery-a839af034db2bd934e4d4fa6758a3fed8de74174.tar.gz
jquery-a839af034db2bd934e4d4fa6758a3fed8de74174.zip
Merge pull request #465 from anton-ryzhov/master
Fixes #10076. $.inArray crashes IE6 and Chrome if second argument is `null` or `undefined` (Thanks anton-ryzhov!)
Diffstat (limited to 'test/unit')
-rw-r--r--test/unit/core.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/unit/core.js b/test/unit/core.js
index 40ee80f6a..a6783e02e 100644
--- a/test/unit/core.js
+++ b/test/unit/core.js
@@ -934,6 +934,16 @@ test("jQuery.makeArray", function(){
same( jQuery.makeArray({length: "5"}), [], "Make sure object is coerced properly.");
});
+test("jQuery.inArray", function(){
+ expect(3);
+
+ equals( jQuery.inArray( 0, false ), -1 , "Search in 'false' as array returns -1 and doesn't throw exception" );
+
+ equals( jQuery.inArray( 0, null ), -1 , "Search in 'null' as array returns -1 and doesn't throw exception" );
+
+ equals( jQuery.inArray( 0, undefined ), -1 , "Search in 'undefined' as array returns -1 and doesn't throw exception" );
+});
+
test("jQuery.isEmptyObject", function(){
expect(2);