@@ -43,7 +43,7 @@ test("show() basic", 2, function() {
4343 // Clean up the detached node
4444 div . remove ( ) ;
4545
46- QUnit . expectJqData ( hiddendiv , "olddisplay" ) ;
46+ QUnit . expectJqData ( this , hiddendiv , "olddisplay" ) ;
4747} ) ;
4848
4949test ( "show()" , 27 , function ( ) {
@@ -94,7 +94,7 @@ test("show()", 27, function () {
9494 } ) ;
9595
9696 // Tolerate data from show()/hide()
97- QUnit . expectJqData ( div , "olddisplay" ) ;
97+ QUnit . expectJqData ( this , div , "olddisplay" ) ;
9898
9999 // #show-tests * is set display: none in CSS
100100 jQuery ( "#qunit-fixture" ) . append ( "<div id='show-tests'><div><p><a href='#'></a></p><code></code><pre></pre><span></span></div><table><thead><tr><th></th></tr></thead><tbody><tr><td></td></tr></tbody></table><ul><li></li></ul></div><table id='test-table'></table>" ) ;
@@ -203,7 +203,7 @@ test("Persist correct display value", function() {
203203
204204 clock . tick ( 300 ) ;
205205
206- QUnit . expectJqData ( $span , "olddisplay" ) ;
206+ QUnit . expectJqData ( this , $span , "olddisplay" ) ;
207207} ) ;
208208
209209test ( "animate(Hash, Object, Function)" , function ( ) {
@@ -1127,7 +1127,8 @@ test("jQuery.show('fast') doesn't clear radio buttons (bug #1095)", function ()
11271127test ( "interrupt toggle" , function ( ) {
11281128 expect ( 24 ) ;
11291129
1130- var longDuration = 2000 ,
1130+ var env = this ,
1131+ longDuration = 2000 ,
11311132 shortDuration = 500 ,
11321133 remaining = 0 ,
11331134 $elems = jQuery ( ".chain-test" ) ,
@@ -1144,7 +1145,7 @@ test( "interrupt toggle", function() {
11441145 jQuery . data ( this , "startVal" , jQuery ( this ) . css ( prop ) ) ;
11451146
11461147 // Expect olddisplay data from our .hide() call below
1147- QUnit . expectJqData ( this , "olddisplay" ) ;
1148+ QUnit . expectJqData ( env , this , "olddisplay" ) ;
11481149 } ) ;
11491150
11501151 // Interrupt a hiding toggle
@@ -1551,7 +1552,8 @@ test( "User supplied callback called after show when fx off (#8892)", 2, functio
15511552test ( "animate should set display for disconnected nodes" , function ( ) {
15521553 expect ( 18 ) ;
15531554
1554- var methods = {
1555+ var env = this ,
1556+ methods = {
15551557 toggle : [ 1 ] ,
15561558 slideToggle : [ ] ,
15571559 fadeIn : [ ] ,
@@ -1572,9 +1574,9 @@ test( "animate should set display for disconnected nodes", function() {
15721574 strictEqual ( $divNone . show ( ) [ 0 ] . style . display , "block" , "show() should change display if it already set to none" ) ;
15731575 strictEqual ( $divInline . show ( ) [ 0 ] . style . display , "inline" , "show() should not change display if it already set" ) ;
15741576
1575- QUnit . expectJqData ( $divTest [ 0 ] , "olddisplay" ) ;
1576- QUnit . expectJqData ( $divEmpty [ 0 ] , "olddisplay" ) ;
1577- QUnit . expectJqData ( $divNone [ 0 ] , "olddisplay" ) ;
1577+ QUnit . expectJqData ( env , $divTest [ 0 ] , "olddisplay" ) ;
1578+ QUnit . expectJqData ( env , $divEmpty [ 0 ] , "olddisplay" ) ;
1579+ QUnit . expectJqData ( env , $divNone [ 0 ] , "olddisplay" ) ;
15781580
15791581 jQuery . each ( methods , function ( name , opt ) {
15801582 jQuery . each ( [
@@ -1589,7 +1591,7 @@ test( "animate should set display for disconnected nodes", function() {
15891591 var callback = [ function ( ) {
15901592 strictEqual ( this . style . display , "block" , "set display to block with " + name ) ;
15911593
1592- QUnit . expectJqData ( this , "olddisplay" ) ;
1594+ QUnit . expectJqData ( env , this , "olddisplay" ) ;
15931595
15941596 } ] ;
15951597 jQuery . fn [ name ] . apply ( this , opt . concat ( callback ) ) ;
0 commit comments