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

This commit is contained in:
Dave Methvin 2011-11-07 11:40:39 -05:00
parent 795583d293
commit 8d2655d20c
2 changed files with 2 additions and 2 deletions

View File

@ -531,7 +531,7 @@ jQuery.extend({
},
error: function( msg ) {
throw msg;
throw new Error( msg );
},
parseJSON: function( data ) {

View File

@ -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" );
}
});