From 02df5e21ddf80699eb9cd22a0471f2475bf89d2d Mon Sep 17 00:00:00 2001 From: kuroky360 Date: Tue, 2 Feb 2016 11:05:22 +0800 Subject: [PATCH] use isUndefined function instead. --- src/Angular.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Angular.js b/src/Angular.js index fb267bfe94c2..56d724d98fc2 100644 --- a/src/Angular.js +++ b/src/Angular.js @@ -1188,7 +1188,7 @@ function toJsonReplacer(key, value) { * @returns {string|undefined} JSON-ified string representing `obj`. */ function toJson(obj, pretty) { - if (typeof obj === 'undefined') return undefined; + if (isUndefined(obj)) return undefined; if (!isNumber(pretty)) { pretty = pretty ? 2 : null; }