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/formatters.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/formatters.js')
| -rw-r--r-- | src/formatters.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/formatters.js b/src/formatters.js index a7a5cc4f..02773be1 100644 --- a/src/formatters.js +++ b/src/formatters.js @@ -1,6 +1,6 @@ function formatter(format, parse) {return {'format':format, 'parse':parse || format};} function toString(obj) { - return (isDefined(obj) && obj !== _null) ? "" + obj : obj; + return (isDefined(obj) && obj !== null) ? "" + obj : obj; } var NUMBER = /^\s*[-+]?\d*(\.\d*)?\s*$/; @@ -94,8 +94,8 @@ angularFormatter['boolean'] = formatter(toString, toBoolean); </doc:example> */ angularFormatter.number = formatter(toString, function(obj){ - if (obj == _null || NUMBER.exec(obj)) { - return obj===_null || obj === '' ? _null : 1*obj; + if (obj == null || NUMBER.exec(obj)) { + return obj===null || obj === '' ? null : 1*obj; } else { throw "Not a number"; } |
