diff options
| author | Igor Minar | 2011-03-26 16:06:38 -0700 | 
|---|---|---|
| committer | Igor Minar | 2011-03-26 23:19:04 -0700 | 
| commit | 1e59822df7366094dbf38b0c4ce0cc979258ad19 (patch) | |
| tree | f171a959e390bda54988369eb634dfd5dc73e30a /src/directives.js | |
| parent | d95a6925cdb5e8009b11fe3ce6dcc8d579bb4234 (diff) | |
| download | angular.js-1e59822df7366094dbf38b0c4ce0cc979258ad19.tar.bz2 | |
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.
Diffstat (limited to 'src/directives.js')
| -rw-r--r-- | src/directives.js | 8 | 
1 files changed, 4 insertions, 4 deletions
diff --git a/src/directives.js b/src/directives.js index 5e611571..32860a1e 100644 --- a/src/directives.js +++ b/src/directives.js @@ -202,7 +202,7 @@ angularDirective("ng:bind", function(expression, element){      var lastValue = noop, lastError = noop;      this.$onEval(function() {        var error, value, html, isHtml, isDomElement, -          oldElement = this.hasOwnProperty($$element) ? this.$element : _undefined; +          oldElement = this.hasOwnProperty($$element) ? this.$element : undefined;        this.$element = element;        value = this.$tryEval(expression, function(e){          error = formatError(e); @@ -229,7 +229,7 @@ angularDirective("ng:bind", function(expression, element){            element.html('');            element.append(value);          } else { -          element.text(value == _undefined ? '' : value); +          element.text(value == undefined ? '' : value);          }        }      }, element); @@ -257,7 +257,7 @@ function compileBindTemplate(template){      });      bindTemplateCache[template] = fn = function(element, prettyPrintJson){        var parts = [], self = this, -         oldElement = this.hasOwnProperty($$element) ? self.$element : _undefined; +         oldElement = this.hasOwnProperty($$element) ? self.$element : undefined;        self.$element = element;        for ( var i = 0; i < bindings.length; i++) {          var value = bindings[i].call(self, element); @@ -767,7 +767,7 @@ angularDirective("ng:style", function(expression, element){      this.$onEval(function(){        var style = this.$eval(expression) || {}, key, mergedStyle = {};        for(key in style) { -        if (resetStyle[key] === _undefined) resetStyle[key] = ''; +        if (resetStyle[key] === undefined) resetStyle[key] = '';          mergedStyle[key] = style[key];        }        for(key in resetStyle) {  | 
