Chromium Code Reviews| Index: dart/lib/compiler/implementation/lib/js_helper.dart |
| diff --git a/dart/lib/compiler/implementation/lib/js_helper.dart b/dart/lib/compiler/implementation/lib/js_helper.dart |
| index 80d93d3d4b016b31f0727a0c8f4f33e1d654d32c..da13b346aa1d231e8d1a6747b389059e5fb17811 100644 |
| --- a/dart/lib/compiler/implementation/lib/js_helper.dart |
| +++ b/dart/lib/compiler/implementation/lib/js_helper.dart |
| @@ -1412,3 +1412,19 @@ String getRuntimeTypeString(var object) { |
| var typeInfo = JS('Object', r'#.builtin$typeInfo', object); |
| return JS('String', r'#.runtimeType', typeInfo); |
| } |
| + |
| +compareHelperNull(compare, a, b) { |
| + if (const NullSentinel() == a) { |
| + a = null; |
| + } |
| + if (const NullSentinel() == b) { |
| + b = null; |
| + } |
| + compare(a, b); |
|
Lasse Reichstein Nielsen
2012/10/18 11:54:50
return result?
(I.e., is this tested? :)
|
| +} |
| + |
| +compareHelper(compare, a, b) => compare(a, b); |
| + |
| +class NullSentinel { |
| + const NullSentinel(); |
| +} |