Index: tests/compiler/dart2js_native/type_error_decode_test.dart |
diff --git a/tests/compiler/dart2js_native/type_error_decode_test.dart b/tests/compiler/dart2js_native/type_error_decode_test.dart |
index 1c37f03964a09acf09893036e71850a8f8c6b293..3c9a8f0ace7c5a0d482559c2113ec25c52208170 100644 |
--- a/tests/compiler/dart2js_native/type_error_decode_test.dart |
+++ b/tests/compiler/dart2js_native/type_error_decode_test.dart |
@@ -4,8 +4,9 @@ |
library test.type_error_decode_test; |
-import 'native_testing.dart'; |
-import 'dart:_js_helper' show NullError, JsNoSuchMethodError; |
+import 'package:expect/expect.dart'; |
+ |
+import 'dart:_js_helper'; |
class Foo { |
var field; |
@@ -40,19 +41,12 @@ main() { |
var s = "Cannot call method 'foo' of null"; |
var nul = null; |
var f = new Foo(); |
- |
+ // This should foil code analysis so the variables aren't inlined below. |
+ [].forEach((y) => f.field = nul = s = x = z = v = y); |
expectThrows(() => x.fisk(), isNullError); |
expectThrows(() => v.fisk(), isNullError); |
expectThrows(() => z.fisk(), isJsNoSuchMethodError); |
expectThrows(() => s.fisk(), isJsNoSuchMethodError); |
expectThrows(() => null(), isNullError); |
expectThrows(() => f.field(), isNullError); |
- |
- expectThrows(() => confuse(x).fisk(), isNullError); |
- expectThrows(() => confuse(v).fisk(), isNullError); |
- expectThrows(() => confuse(z).fisk(), isJsNoSuchMethodError); |
- expectThrows(() => confuse(s).fisk(), isJsNoSuchMethodError); |
- expectThrows(() => confuse(null)(), isNullError); |
- expectThrows(() => confuse(f).field(), isNullError); |
- expectThrows(() => confuse(f.field)(), isNullError); |
} |