mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-05-09 15:24:43 +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) {
|
function toJsonReplacer(key, value) {
|
||||||
var val = value;
|
var val = value;
|
||||||
|
|
||||||
if (/^\$+/.test(key)) {
|
if (typeof key === 'string' && key.charAt(0) === '$') {
|
||||||
val = undefined;
|
val = undefined;
|
||||||
} else if (isWindow(value)) {
|
} else if (isWindow(value)) {
|
||||||
val = '$WINDOW';
|
val = '$WINDOW';
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue