@@ -1411,9 +1411,9 @@ QUnit.test( "jQuery.parseXML", function( assert ) {
14111411 }
14121412 try {
14131413 xml = jQuery . parseXML ( "<p>Not a <<b>well-formed</b> xml string</p>" ) ;
1414- assert . ok ( false , "invalid xml not detected" ) ;
1414+ assert . ok ( false , "invalid XML not detected" ) ;
14151415 } catch ( e ) {
1416- assert . strictEqual ( e . message , "Invalid XML: <p>Not a <<b>well-formed</b> xml string</p>" , "invalid xml detected" ) ;
1416+ assert . ok ( e . message . indexOf ( "Invalid XML:" ) === 0 , "invalid XML detected" ) ;
14171417 }
14181418 try {
14191419 xml = jQuery . parseXML ( "" ) ;
@@ -1429,6 +1429,29 @@ QUnit.test( "jQuery.parseXML", function( assert ) {
14291429 }
14301430} ) ;
14311431
1432+ // Support: IE 11+
1433+ // IE throws an error when parsing invalid XML instead of reporting the error
1434+ // in a `parsererror` element, skip the test there.
1435+ QUnit . testUnlessIE ( "jQuery.parseXML - error reporting" , function ( assert ) {
1436+ assert . expect ( 2 ) ;
1437+
1438+ var errorArg , lineMatch , line , columnMatch , column ;
1439+
1440+ sinon . stub ( jQuery , "error" ) ;
1441+
1442+ jQuery . parseXML ( "<p>Not a <<b>well-formed</b> xml string</p>" ) ;
1443+ errorArg = jQuery . error . firstCall . lastArg . toLowerCase ( ) ;
1444+ console . log ( "errorArg" , errorArg ) ;
1445+
1446+ lineMatch = errorArg . match ( / l i n e \s * (?: n u m b e r ) ? \s * ( \d + ) / ) ;
1447+ line = lineMatch && lineMatch [ 1 ] ;
1448+ columnMatch = errorArg . match ( / c o l u m n \s * ( \d + ) / ) ;
1449+ column = columnMatch && columnMatch [ 1 ] ;
1450+
1451+ assert . strictEqual ( line , "1" , "reports error line" ) ;
1452+ assert . strictEqual ( column , "11" , "reports error column" ) ;
1453+ } ) ;
1454+
14321455testIframe (
14331456 "Conditional compilation compatibility (#13274)" ,
14341457 "core/cc_on.html" ,
0 commit comments