diff --git a/map/map.js b/map/map.js index 2183c44480d..6f1f9eb8f44 100644 --- a/map/map.js +++ b/map/map.js @@ -103,7 +103,7 @@ steal('can/util', 'can/util/bind','./bubble.js', 'can/construct', 'can/util/batc return [attr]; } // Split key on '.' - return can.isArray(attr) ? attr : ("" + attr) + return typeof attr === "object" ? attr : ("" + attr) .split("."); }, /** @@ -336,7 +336,6 @@ steal('can/util', 'can/util/bind','./bubble.js', 'can/construct', 'can/util/batc return this._attrs(attr, val); // If we are getting a value. } else if (arguments.length === 1) { - // Let people know we are reading. can.__reading(this, attr); return this._get(attr); } else { @@ -390,6 +389,7 @@ steal('can/util', 'can/util/bind','./bubble.js', 'can/construct', 'can/util/batc }, // Reads a property from the `object`. _get: function (attr) { + var value; // Handles the case of a key having a `.` in its name @@ -510,7 +510,7 @@ steal('can/util', 'can/util/bind','./bubble.js', 'can/construct', 'can/util/batc } // Add property directly for easy writing. // Check if its on the `prototype` so we don't overwrite methods like `attrs`. - if (! typeof this.constructor.prototype[prop] === 'function' && !this._computedBindings[prop] ) { + if ( typeof this.constructor.prototype[prop] !== 'function' && !this._computedBindings[prop] ) { this[prop] = val; } }, diff --git a/map/map_test.js b/map/map_test.js index a7b0aac89ee..787c1ac5ef0 100644 --- a/map/map_test.js +++ b/map/map_test.js @@ -70,8 +70,8 @@ steal("can/map", "can/compute", "can/test", "can/list", function(){ }); state.removeAttr("key.with.dots"); state2.removeAttr("key.with.someValue"); - deepEqual(can.Map.keys(state), ["productType"], "one property"); - deepEqual(can.Map.keys(state2), ["key.with.dots", "key"], "two properties"); + deepEqual( can.Map.keys(state), ["productType"], "one property"); + deepEqual( can.Map.keys(state2), ["key.with.dots", "key"], "two properties"); deepEqual( can.Map.keys( state2.key["with"] ) , [], "zero properties"); }); diff --git a/map/test.html b/map/test.html index 16ff9b68e4c..d28c2be9969 100644 --- a/map/test.html +++ b/map/test.html @@ -27,7 +27,7 @@
can.dev.logLevel = 3; QUnit.start(); }); - },300); + },400);