diff options
| author | Boris Serdyuk | 2013-09-21 12:38:09 +0400 |
|---|---|---|
| committer | Pete Bacon Darwin | 2013-09-23 11:16:33 +0100 |
| commit | 301647bf1b6da9303b39b3c8c8a88f15eaf1b7b3 (patch) | |
| tree | e1df18bc5ab8975cb585119017e59fe101667d2e | |
| parent | 1c03a1b9c0bc37b8b3b06e38ae1d6671307e5605 (diff) | |
| download | angular.js-301647bf1b6da9303b39b3c8c8a88f15eaf1b7b3.tar.bz2 | |
refactor(angular.toJson): use charAt instead of regexp
Provides a performance improvement when serializing to JSON strings.
Closes #4093
| -rw-r--r-- | src/Angular.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Angular.js b/src/Angular.js index 8c322460..b438270c 100644 --- a/src/Angular.js +++ b/src/Angular.js @@ -758,7 +758,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'; |
