Home page Forum Wiki Mail Jabber Devel NIX-FILES

AltLUG Git

Git-repositories of Altai Linux User Group

Fix #12191. jQuery.type should return "error" for Error objects.
authorDave Methvin <dave.methvin@gmail.com>
Sat, 24 Nov 2012 22:22:14 +0000 (17:22 -0500)
committerDave Methvin <dave.methvin@gmail.com>
Sat, 24 Nov 2012 22:22:14 +0000 (17:22 -0500)
src/core.js
test/unit/core.js

index 19246d1..9c49888 100644 (file)
@@ -902,7 +902,7 @@ jQuery.ready.promise = function( obj ) {
 };
 
 // Populate the class2type map
-jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(i, name) {
+jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) {
        class2type[ "[object " + name + "]" ] = name.toLowerCase();
 });
 
index 14268d8..603368b 100644 (file)
@@ -250,7 +250,7 @@ test("trim", function() {
 });
 
 test("type", function() {
-       expect(23);
+       expect( 24 );
 
        equal( jQuery.type(null), "null", "null" );
        equal( jQuery.type(undefined), "undefined", "undefined" );
@@ -270,6 +270,7 @@ test("type", function() {
        equal( jQuery.type(new Date()), "date", "Date" );
        equal( jQuery.type(new Function("return;")), "function", "Function" );
        equal( jQuery.type(function(){}), "function", "Function" );
+       equal( jQuery.type(new Error()), "error", "Error" );
        equal( jQuery.type(window), "object", "Window" );
        equal( jQuery.type(document), "object", "Document" );
        equal( jQuery.type(document.body), "object", "Element" );

Hosting is provided AltSPAHow to use Git
Please direct any questions on jabber alex.wolf@jabber.ru

Valid HTML 4.0 Transitional Valid CSS!

Designer Alexander Wolf