mirror of
https://github.com/jquery/jquery.git
synced 2026-02-14 07:25:15 -05:00
Data: do not create data cache when fetching single property
Closes gh-2554
This commit is contained in:
committed by
Michał Gołębiowski
parent
5adf04a73c
commit
f5bf9bc488
@@ -882,3 +882,19 @@ QUnit.test( "Check that the expando is removed when there's no more data", funct
|
||||
}
|
||||
}
|
||||
} );
|
||||
|
||||
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" );
|
||||
}
|
||||
}
|
||||
} );
|
||||
|
||||
Reference in New Issue
Block a user