Index: pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/operations.dart |
diff --git a/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/operations.dart b/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/operations.dart |
index 5e94d58999f4f382716699c9430c09b6b5e0602c..6bacda511799a300a47608e489637d14340bafd7 100644 |
--- a/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/operations.dart |
+++ b/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/operations.dart |
@@ -548,14 +548,22 @@ check(obj, type) { |
return obj; |
} |
-bool test(obj) { |
- if (obj is bool) return obj; |
- return booleanConversionFailed(obj); |
+bool test(bool obj) { |
+ if (obj == null) _throwBooleanConversionError(); |
+ return obj; |
} |
-bool booleanConversionFailed(obj) { |
- if (obj == null) { |
+bool dtest(obj) { |
+ if (obj is! bool) booleanConversionFailed(obj); |
+ return obj; |
+} |
+ |
+void _throwBooleanConversionError() => |
throw new BooleanConversionAssertionError(); |
+ |
+void booleanConversionFailed(obj) { |
+ if (obj == null) { |
+ _throwBooleanConversionError(); |
} |
var actual = getReifiedType(obj); |
var expected = JS('', '#', bool); |