diff options
| author | Boris Serdyuk | 2013-09-21 12:38:09 +0400 |
|---|---|---|
| committer | Pete Bacon Darwin | 2013-09-23 11:16:16 +0100 |
| commit | 6c59e770084912d2345e7f83f983092a2d305ae3 (patch) | |
| tree | c4e16da4ad29ac552026d94e3aa7a5eea212a63c /src/Angular.js | |
| parent | e2751292dac5f7f4813bd2a3f0e8bbe3dcf4d6d9 (diff) | |
| download | angular.js-6c59e770084912d2345e7f83f983092a2d305ae3.tar.bz2 | |
refactor(angular.toJson): use charAt instead of regexp
Provides a performance improvement when serializing to JSON strings.
Closes #4093
Diffstat (limited to 'src/Angular.js')
| -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 bf10fe34..740cd691 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'; |
