aboutsummaryrefslogtreecommitdiffstats
path: root/src/Angular.js
diff options
context:
space:
mode:
authorBoris Serdyuk2013-09-21 12:38:09 +0400
committerPete Bacon Darwin2013-09-23 11:16:16 +0100
commit6c59e770084912d2345e7f83f983092a2d305ae3 (patch)
treec4e16da4ad29ac552026d94e3aa7a5eea212a63c /src/Angular.js
parente2751292dac5f7f4813bd2a3f0e8bbe3dcf4d6d9 (diff)
downloadangular.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.js2
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';