From 31c79f51415308e83b26d589e2da996c176c5e0d Mon Sep 17 00:00:00 2001 From: Boris Serdyuk Date: Sat, 21 Sep 2013 12:38:09 +0400 Subject: [PATCH] refactor(angular.toJson): use charAt instead of regexp --- src/Angular.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Angular.js b/src/Angular.js index bf10fe342bf3..740cd6911427 100644 --- a/src/Angular.js +++ b/src/Angular.js @@ -781,7 +781,7 @@ function bind(self, fn) { function toJsonReplacer(key, value) { var val = value; - if (/^\$+/.test(key)) { + if (typeof key === 'string' && key.charAt(0) === '$') { val = undefined; } else if (isWindow(value)) { val = '$WINDOW';