mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
Adjusts unit test regarding exception in injected scripts so that it accounts for the exception being thrown in an event loop for remote scripts
This commit is contained in:
parent
7cc629d097
commit
18c376a5bd
@ -2050,17 +2050,21 @@ test( "Ensure oldIE creates a new set on appendTo (#8894)", function() {
|
||||
|
||||
test( "html() - script exceptions bubble (#11743)", function() {
|
||||
|
||||
expect( 2 );
|
||||
expect( 3 );
|
||||
|
||||
raises(function() {
|
||||
jQuery("#qunit-fixture").html("<script>undefined(); ok( false, 'error not thrown' );</script>");
|
||||
ok( false, "error ignored" );
|
||||
}, "exception bubbled from inline script" );
|
||||
jQuery("#qunit-fixture").html("<script>undefined(); ok( false, 'Exception not thrown' );</script>");
|
||||
ok( false, "Exception ignored" );
|
||||
}, "Exception bubbled from inline script" );
|
||||
|
||||
raises(function() {
|
||||
jQuery("#qunit-fixture").html("<script src='data/badcall.js'></script>");
|
||||
ok( false, "error ignored" );
|
||||
}, "exception bubbled from remote script" );
|
||||
var onerror = window.onerror;
|
||||
window.onerror = function() {
|
||||
ok( true, "Exception thrown in remote script" );
|
||||
window.onerror = onerror;
|
||||
};
|
||||
|
||||
jQuery("#qunit-fixture").html("<script src='data/badcall.js'></script>");
|
||||
ok( true, "Exception ignored" );
|
||||
});
|
||||
|
||||
test( "checked state is cloned with clone()", function() {
|
||||
|
Loading…
Reference in New Issue
Block a user