diff options
author | Corey Frang <gnarf@gnarf.net> | 2011-11-06 17:24:44 -0500 |
---|---|---|
committer | Dave Methvin <dave.methvin@gmail.com> | 2011-11-06 17:24:44 -0500 |
commit | 471290deb6fd97c6a16cb4d969f277572db7f558 (patch) | |
tree | fbb078de0b440a0e8360a682218af9e5bae7493d /src/data.js | |
parent | 47c605f693457412a53c9145cafe55420ab8f236 (diff) | |
download | jquery-471290deb6fd97c6a16cb4d969f277572db7f558.tar.gz jquery-471290deb6fd97c6a16cb4d969f277572db7f558.zip |
Removing a stale line of code in `.data()`
Diffstat (limited to 'src/data.js')
-rw-r--r-- | src/data.js | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/src/data.js b/src/data.js index b4c53250c..028afa5a1 100644 --- a/src/data.js +++ b/src/data.js @@ -158,19 +158,21 @@ jQuery.extend({ if ( thisCache ) { - // Support space separated names - if ( jQuery.isArray( name ) ) { - name = name; - } else if ( name in thisCache ) { - name = [ name ]; - } else { - - // split the camel cased version by spaces - name = jQuery.camelCase( name ); + // Support array or space separated string names for data keys + if ( !jQuery.isArray( name ) ) { + + // try the string as a key before any manipulation if ( name in thisCache ) { name = [ name ]; } else { - name = name.split( " " ); + + // split the camel cased version by spaces unless a key with the spaces exists + name = jQuery.camelCase( name ); + if ( name in thisCache ) { + name = [ name ]; + } else { + name = name.split( " " ); + } } } |