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/Angular.js | 6 ++---- src/Browser.js | 4 ++-- src/Compiler.js | 2 +- src/JSON.js | 6 +++--- src/Resource.js | 2 +- src/Scope.js | 2 +- src/apis.js | 2 +- src/directives.js | 8 ++++---- src/formatters.js | 6 +++--- src/jqLite.js | 2 +- src/markups.js | 4 ++-- src/parser.js | 4 ++-- src/service/cookies.js | 2 +- src/service/hover.js | 2 +- src/service/location.js | 4 ++-- src/service/route.js | 6 +++--- src/service/xhr.bulk.js | 2 +- src/service/xhr.cache.js | 2 +- src/service/xhr.js | 2 +- src/validators.js | 20 ++++++++++---------- src/widgets.js | 16 ++++++++-------- 21 files changed, 51 insertions(+), 53 deletions(-) (limited to 'src') diff --git a/src/Angular.js b/src/Angular.js index a91bf04c..b2949646 100644 --- a/src/Angular.js +++ b/src/Angular.js @@ -52,9 +52,7 @@ if ('i' !== 'I'.toLowerCase()) { function fromCharCode(code) { return String.fromCharCode(code); } -var _undefined = undefined, - _null = null, - $$element = '$element', +var $$element = '$element', $$update = '$update', $$scope = '$scope', $$validate = '$validate', @@ -315,7 +313,7 @@ function isDefined(value){ return typeof value != $undefined; } * @param {*} value Reference to check. * @returns {boolean} True if `value` is an `Object` but not `null`. */ -function isObject(value){ return value!=_null && typeof value == $object;} +function isObject(value){ return value!=null && typeof value == $object;} /** diff --git a/src/Browser.js b/src/Browser.js index e51df16c..55439762 100644 --- a/src/Browser.js +++ b/src/Browser.js @@ -95,7 +95,7 @@ function Browser(window, document, body, XHR, $log) { var script = jqLite('