mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-17 07:40:22 +00:00
refactor(angular.toJson): use charAt instead of regexp
Provides a performance improvement when serializing to JSON strings. Closes #4093
This commit is contained in:
parent
1c03a1b9c0
commit
301647bf1b
1 changed files with 1 additions and 1 deletions
|
|
@ -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';
|
||||
|
|
|
|||
Loading…
Reference in a new issue