diff options
| author | Misko Hevery | 2010-08-18 16:23:12 -0700 |
|---|---|---|
| committer | Misko Hevery | 2010-08-18 17:26:33 -0700 |
| commit | 5ddd8d958686c5075b6c58b700f19b4bdea90e1d (patch) | |
| tree | f43da0153fb41244425c00fc728a17028671ce03 /src/formatters.js | |
| parent | 1087270c95f6bbafd3715c9a5eecdafac79c9daa (diff) | |
| download | angular.js-5ddd8d958686c5075b6c58b700f19b4bdea90e1d.tar.bz2 | |
stringify names for better compression, remove dead functions, removed underscore.js compatibility
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 5c8764ac..ba57a3ed 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*$/; @@ -9,8 +9,8 @@ angularFormatter.noop = formatter(identity, identity); angularFormatter.json = formatter(toJson, fromJson); angularFormatter['boolean'] = formatter(toString, toBoolean); 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"; } |
