From 1e59822df7366094dbf38b0c4ce0cc979258ad19 Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Sat, 26 Mar 2011 16:06:38 -0700 Subject: remove _null and _undefined they have no significant effect on minified and gziped size. in fact they make things worse. file | before | after removal ---------------------------------------- concat | 325415 | 325297 min | 62070 | 62161 min + gzip | 25187 | 25176 The bottom line is that we are getting 0.05% decrease in size after gzip without all of the hassle of using underscores everywhere. --- src/JSON.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/JSON.js') diff --git a/src/JSON.js b/src/JSON.js index 52d5a763..5e13dc45 100644 --- a/src/JSON.js +++ b/src/JSON.js @@ -15,7 +15,7 @@ var array = [].constructor; */ function toJson(obj, pretty) { var buf = []; - toJsonArray(buf, obj, pretty ? "\n " : _null, []); + toJsonArray(buf, obj, pretty ? "\n " : null, []); return buf.join(''); } @@ -87,7 +87,7 @@ function toJsonArray(buf, obj, pretty, stack) { } stack.push(obj); } - if (obj === _null) { + if (obj === null) { buf.push($null); } else if (obj instanceof RegExp) { buf.push(angular['String']['quoteUnicode'](obj.toString())); @@ -128,7 +128,7 @@ function toJsonArray(buf, obj, pretty, stack) { var childPretty = pretty ? pretty + " " : false; var keys = []; for(var k in obj) { - if (obj[k] === _undefined) + if (obj[k] === undefined) continue; keys.push(k); } -- cgit v1.2.3