mirror of
https://github.com/jquery/jquery.git
synced 2026-04-20 03:01:22 -04:00
Core: Deprecate jQuery.isWindow
Fixes gh-3629 Close gh-3702
This commit is contained in:
committed by
Timmy Willison
parent
490db839fb
commit
c18d608537
@@ -76,7 +76,7 @@ QUnit.test( "show/hide", function( assert ) {
|
||||
}
|
||||
|
||||
QUnit.test( "core", function( assert ) {
|
||||
assert.expect( 27 );
|
||||
assert.expect( 25 );
|
||||
|
||||
var elem = jQuery( "<div></div><span></span>" );
|
||||
|
||||
@@ -100,9 +100,6 @@ QUnit.test( "core", function( assert ) {
|
||||
"<?xml version='1.0' encoding='UTF-8'?><foo bar='baz'></foo>"
|
||||
) ), "jQuery.isXMLDoc" );
|
||||
|
||||
assert.ok( jQuery.isWindow( window ), "jQuery.isWindow(window)" );
|
||||
assert.ok( !jQuery.isWindow( 2 ), "jQuery.isWindow(Number)" );
|
||||
|
||||
assert.strictEqual( jQuery.inArray( 3, [ "a", 6, false, 3, {} ] ), 3, "jQuery.inArray - true" );
|
||||
assert.strictEqual(
|
||||
jQuery.inArray( 3, [ "a", 6, false, "3", {} ] ),
|
||||
|
||||
@@ -680,25 +680,6 @@ QUnit.test( "isXMLDoc - XML", function( assert ) {
|
||||
assert.ok( jQuery.isXMLDoc( jQuery( "tab", xml )[ 0 ] ), "XML Tab Element" );
|
||||
} );
|
||||
|
||||
QUnit.test( "isWindow", function( assert ) {
|
||||
assert.expect( 14 );
|
||||
|
||||
assert.ok( jQuery.isWindow( window ), "window" );
|
||||
assert.ok( jQuery.isWindow( document.getElementsByTagName( "iframe" )[ 0 ].contentWindow ), "iframe.contentWindow" );
|
||||
assert.ok( !jQuery.isWindow(), "empty" );
|
||||
assert.ok( !jQuery.isWindow( null ), "null" );
|
||||
assert.ok( !jQuery.isWindow( undefined ), "undefined" );
|
||||
assert.ok( !jQuery.isWindow( document ), "document" );
|
||||
assert.ok( !jQuery.isWindow( document.documentElement ), "documentElement" );
|
||||
assert.ok( !jQuery.isWindow( "" ), "string" );
|
||||
assert.ok( !jQuery.isWindow( 1 ), "number" );
|
||||
assert.ok( !jQuery.isWindow( true ), "boolean" );
|
||||
assert.ok( !jQuery.isWindow( {} ), "object" );
|
||||
assert.ok( !jQuery.isWindow( { setInterval: function() {} } ), "fake window" );
|
||||
assert.ok( !jQuery.isWindow( /window/ ), "regexp" );
|
||||
assert.ok( !jQuery.isWindow( function() {} ), "function" );
|
||||
} );
|
||||
|
||||
QUnit.test( "jQuery('html')", function( assert ) {
|
||||
assert.expect( 18 );
|
||||
|
||||
|
||||
@@ -164,3 +164,22 @@ QUnit.test( "jQuery.nodeName", function( assert ) {
|
||||
"Works on custom elements (true)"
|
||||
);
|
||||
} );
|
||||
|
||||
QUnit.test( "jQuery.isWindow", function( assert ) {
|
||||
assert.expect( 14 );
|
||||
|
||||
assert.ok( jQuery.isWindow( window ), "window" );
|
||||
assert.ok( jQuery.isWindow( document.getElementsByTagName( "iframe" )[ 0 ].contentWindow ), "iframe.contentWindow" );
|
||||
assert.ok( !jQuery.isWindow(), "empty" );
|
||||
assert.ok( !jQuery.isWindow( null ), "null" );
|
||||
assert.ok( !jQuery.isWindow( undefined ), "undefined" );
|
||||
assert.ok( !jQuery.isWindow( document ), "document" );
|
||||
assert.ok( !jQuery.isWindow( document.documentElement ), "documentElement" );
|
||||
assert.ok( !jQuery.isWindow( "" ), "string" );
|
||||
assert.ok( !jQuery.isWindow( 1 ), "number" );
|
||||
assert.ok( !jQuery.isWindow( true ), "boolean" );
|
||||
assert.ok( !jQuery.isWindow( {} ), "object" );
|
||||
assert.ok( !jQuery.isWindow( { setInterval: function() {} } ), "fake window" );
|
||||
assert.ok( !jQuery.isWindow( /window/ ), "regexp" );
|
||||
assert.ok( !jQuery.isWindow( function() {} ), "function" );
|
||||
} );
|
||||
|
||||
Reference in New Issue
Block a user