diff options
-rw-r--r-- | src/core.js | 4 | ||||
-rw-r--r-- | test/unit/data.js | 9 |
2 files changed, 8 insertions, 5 deletions
diff --git a/src/core.js b/src/core.js index db988a9b5..7a77ae132 100644 --- a/src/core.js +++ b/src/core.js @@ -46,11 +46,11 @@ var jQuery = function( selector, context ) { rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/, // Matches dashed string for camelizing - rdashAlpha = /-([a-z])/ig, + rdashAlpha = /-([a-z]|[0-9])/ig, // Used by jQuery.camelCase as callback to replace() fcamelCase = function( all, letter ) { - return letter.toUpperCase(); + return ( letter + "" ).toUpperCase(); }, // Keep a UserAgent string for use with jQuery.browser diff --git a/test/unit/data.js b/test/unit/data.js index 55201b4e3..4e21f563e 100644 --- a/test/unit/data.js +++ b/test/unit/data.js @@ -538,10 +538,13 @@ test("jQuery.data supports interoperable hyphenated/camelCase get/set of propert "an-object": {}, "bool-true": true, "bool-false": false, - "some-json": '{ "foo": "bar" }' + "some-json": '{ "foo": "bar" }', + "num-1-middle": true, + "num-end-2": true, + "2-num-start": true }; - expect( 18 ); + expect( 24 ); jQuery.each( datas, function( key, val ) { div.data( key, val ); @@ -578,4 +581,4 @@ test("jQuery.data supports interoperable removal of hyphenated/camelCase propert equal( div.data( key ), undefined, "get: " + key ); }); -});
\ No newline at end of file +}); |