Data: do not create data cache when fetching single property

Closes gh-2554
This commit is contained in:
Jason Bedard
2015-08-23 14:23:35 -07:00
committed by Michał Gołębiowski
parent 5adf04a73c
commit f5bf9bc488
2 changed files with 18 additions and 4 deletions

View File

@@ -72,13 +72,11 @@ Data.prototype = {
return cache;
},
get: function( owner, key ) {
var cache = this.cache( owner );
return key === undefined ?
cache :
this.cache( owner ) :
// Always use camelCase key (gh-2257)
cache[ jQuery.camelCase( key ) ];
owner[ this.expando ] && owner[ this.expando ][ jQuery.camelCase( key ) ];
},
access: function( owner, key, value ) {