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';