Commit 8d2655d2 authored by Dave Methvin's avatar Dave Methvin

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

parent 795583d2
...@@ -531,7 +531,7 @@ jQuery.extend({ ...@@ -531,7 +531,7 @@ jQuery.extend({
}, },
error: function( msg ) { error: function( msg ) {
throw msg; throw new Error( msg );
}, },
parseJSON: function( data ) { parseJSON: function( data ) {
......
...@@ -1129,7 +1129,7 @@ test("jQuery.parseXML", 4, function(){ ...@@ -1129,7 +1129,7 @@ test("jQuery.parseXML", 4, function(){
xml = jQuery.parseXML( "<p>Not a <<b>well-formed</b> xml string</p>" ); xml = jQuery.parseXML( "<p>Not a <<b>well-formed</b> xml string</p>" );
ok( false, "invalid xml not detected" ); ok( false, "invalid xml not detected" );
} catch( e ) { } 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" );
} }
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment