diff options
author | Nilton Cesar <niltoncms@gmail.com> | 2017-11-22 14:43:44 -0500 |
---|---|---|
committer | Timmy Willison <4timmywil@gmail.com> | 2018-01-08 11:21:22 -0500 |
commit | 64a289286a743516bce82462200062a647ef3ac0 (patch) | |
tree | a98de0017aa21c031f59d1b21bd9ccea01a66f8d /src/data/Data.js | |
parent | 3c0f2cfb05c94adb164ac863a96eb2cf09e8110a (diff) | |
download | jquery-64a289286a743516bce82462200062a647ef3ac0.tar.gz jquery-64a289286a743516bce82462200062a647ef3ac0.zip |
Core: make camelCase function available only for internal usage
Close gh-3604
Fixes gh-3384
Diffstat (limited to 'src/data/Data.js')
-rw-r--r-- | src/data/Data.js | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/data/Data.js b/src/data/Data.js index 8c856c039..31ff4318c 100644 --- a/src/data/Data.js +++ b/src/data/Data.js @@ -1,8 +1,9 @@ define( [ "../core", + "../core/camelCase", "../var/rnothtmlwhite", "./var/acceptData" -], function( jQuery, rnothtmlwhite, acceptData ) { +], function( jQuery, camelCase, rnothtmlwhite, acceptData ) { "use strict"; @@ -54,14 +55,14 @@ Data.prototype = { // Handle: [ owner, key, value ] args // Always use camelCase key (gh-2257) if ( typeof data === "string" ) { - cache[ jQuery.camelCase( data ) ] = value; + cache[ camelCase( data ) ] = value; // Handle: [ owner, { properties } ] args } else { // Copy the properties one-by-one to the cache object for ( prop in data ) { - cache[ jQuery.camelCase( prop ) ] = data[ prop ]; + cache[ camelCase( prop ) ] = data[ prop ]; } } return cache; @@ -71,7 +72,7 @@ Data.prototype = { this.cache( owner ) : // Always use camelCase key (gh-2257) - owner[ this.expando ] && owner[ this.expando ][ jQuery.camelCase( key ) ]; + owner[ this.expando ] && owner[ this.expando ][ camelCase( key ) ]; }, access: function( owner, key, value ) { @@ -119,9 +120,9 @@ Data.prototype = { // If key is an array of keys... // We always set camelCase keys, so remove that. - key = key.map( jQuery.camelCase ); + key = key.map( camelCase ); } else { - key = jQuery.camelCase( key ); + key = camelCase( key ); // If a key with the spaces exists, use it. // Otherwise, create an array by matching non-whitespace |