From ccfb3f9bb4f6cadf04cc7c0efd570fc4e3a2bfa4 Mon Sep 17 00:00:00 2001 From: Nathan Jovin Date: Wed, 8 Apr 2015 08:32:41 -0700 Subject: [PATCH 1/2] Allow isReserved() to handle numeric inputs so an error isn't thrown when an int is passed when dealing with numerically-keyed objects --- src/util/lang.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/util/lang.js b/src/util/lang.js index 3ffa257ce4a..24d17d62a98 100644 --- a/src/util/lang.js +++ b/src/util/lang.js @@ -6,6 +6,9 @@ */ exports.isReserved = function (str) { + if(typeof str == 'number') { + return false; + } var c = str.charCodeAt(0) return c === 0x24 || c === 0x5F } From 8eed69c6de9041a27f9370adf25d8a7bd3b380ce Mon Sep 17 00:00:00 2001 From: Nathan Jovin Date: Mon, 13 Apr 2015 22:24:07 -0700 Subject: [PATCH 2/2] #772 cast object keys to strings rather than handling numeric input specifically --- src/util/lang.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/util/lang.js b/src/util/lang.js index 24d17d62a98..210cf55cd0f 100644 --- a/src/util/lang.js +++ b/src/util/lang.js @@ -6,10 +6,7 @@ */ exports.isReserved = function (str) { - if(typeof str == 'number') { - return false; - } - var c = str.charCodeAt(0) + var c = (str + '').charCodeAt(0) return c === 0x24 || c === 0x5F }