refactor(angular.toJson): use charAt instead of regexp
Provides a performance improvement when serializing to JSON strings. Closes #4093
This commit is contained in:
committed by
Pete Bacon Darwin
parent
1c03a1b9c0
commit
301647bf1b
+1
-1
@@ -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';
|
||||
|
||||
Reference in New Issue
Block a user