Permalink
Browse files

Fix #10646. Throw an Error object from `.error()` for IE's sake.

  • Loading branch information...
dmethvin committed Nov 7, 2011
1 parent 795583d commit 8d2655d20c46e7356d832e855c76b813679ccecf
Showing with 2 additions and 2 deletions.
  1. +1 −1 src/core.js
  2. +1 −1 test/unit/core.js
View
@@ -531,7 +531,7 @@ jQuery.extend({
},
error: function( msg ) {
- throw msg;
+ throw new Error( msg );
},
parseJSON: function( data ) {
View
@@ -1129,7 +1129,7 @@ test("jQuery.parseXML", 4, function(){
xml = jQuery.parseXML( "<p>Not a <<b>well-formed</b> xml string</p>" );
ok( false, "invalid xml not detected" );
} catch( e ) {
- strictEqual( e, "Invalid XML: <p>Not a <<b>well-formed</b> xml string</p>", "invalid xml detected" );
+ strictEqual( e.message, "Invalid XML: <p>Not a <<b>well-formed</b> xml string</p>", "invalid xml detected" );
}
});

0 comments on commit 8d2655d

Please sign in to comment.