Skip to content

Commit

Permalink
Fix #10646. Throw an Error object from .error() for IE's sake.
Browse files Browse the repository at this point in the history
  • Loading branch information
dmethvin committed Nov 7, 2011
1 parent 795583d commit 8d2655d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ jQuery.extend({
},

error: function( msg ) {
throw msg;
throw new Error( msg );
},

parseJSON: function( data ) {
Expand Down
2 changes: 1 addition & 1 deletion test/unit/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -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" );
}
});

Expand Down

0 comments on commit 8d2655d

Please sign in to comment.