mirror of
https://github.com/jquery/jquery.git
synced 2025-01-10 18:24:24 +00:00
Tests: do not create data cache when fetching single property
(test cherry-picked from f5bf9bc488
)
Refs gh-2554
This commit is contained in:
parent
bec2ba2312
commit
0874096797
@ -1121,3 +1121,19 @@ testIframeWithCallback(
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
QUnit.test( ".data(prop) does not create expando", function( assert ) {
|
||||||
|
assert.expect( 1 );
|
||||||
|
|
||||||
|
var key,
|
||||||
|
div = jQuery( "<div/>" );
|
||||||
|
|
||||||
|
div.data("foo");
|
||||||
|
assert.equal( false, jQuery.hasData( div[0] ) );
|
||||||
|
// Make sure no expando has been added
|
||||||
|
for ( key in div[ 0 ] ) {
|
||||||
|
if ( /^jQuery/.test( key ) ) {
|
||||||
|
assert.ok( false, "Expando was created on access" );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} );
|
||||||
|
Loading…
Reference in New Issue
Block a user