OLD | NEW |
1 library angular.util; | 1 library angular.util; |
2 | 2 |
3 bool toBool(x) { | 3 bool toBool(x) { |
4 if (x is bool) return x; | 4 if (x is bool) return x; |
5 if (x is num) return x != 0; | 5 if (x is num) return x != 0; |
6 return false; | 6 return false; |
7 } | 7 } |
8 | 8 |
9 typedef FnWith0Args(); | 9 typedef FnWith0Args(); |
10 typedef FnWith1Args(a0); | 10 typedef FnWith1Args(a0); |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 "switch", | 111 "switch", |
112 "this", | 112 "this", |
113 "throw", | 113 "throw", |
114 "true", | 114 "true", |
115 "try", | 115 "try", |
116 "var", | 116 "var", |
117 "void", | 117 "void", |
118 "while", | 118 "while", |
119 "with" | 119 "with" |
120 ]); | 120 ]); |
| 121 |
| 122 /// Returns true iff o is [double.NAN]. |
| 123 /// In particular, returns false if o is null. |
| 124 bool isNaN(Object o) => o is num && o.isNaN; |
| 125 |
| 126 /// Returns true iff o1 == o2 or both are [double.NAN]. |
| 127 bool eqOrNaN(Object o1, Object o2) => o1 == o2 || (isNaN(o1) && isNaN(o2)); |
OLD | NEW |