Index: pkg/dev_compiler/test/browser/runtime_tests.js |
diff --git a/pkg/dev_compiler/test/browser/runtime_tests.js b/pkg/dev_compiler/test/browser/runtime_tests.js |
index acce540dd37d1bf196577a5ffb2578878ac2fd71..6ed5f16ca2c20929172d3a06e232e8de50fc3f3b 100644 |
--- a/pkg/dev_compiler/test/browser/runtime_tests.js |
+++ b/pkg/dev_compiler/test/browser/runtime_tests.js |
@@ -10,6 +10,35 @@ define(['dart_sdk'], function(dart_sdk) { |
const dart = dart_sdk.dart; |
const dartx = dart.dartx; |
+ dart.trapRuntimeErrors(false); |
+ |
+ suite('ignore', () => { |
+ "use strict"; |
+ |
+ let FutureOr = async.FutureOr$; |
+ let Future = async.Future$; |
+ let List = core.List$; |
+ |
+ setup(() => { |
+ dart_sdk.dart.ignoreWhitelistedErrors(false); |
+ }); |
+ |
+ teardown(() => { |
+ dart_sdk.dart.ignoreWhitelistedErrors(false); |
+ }); |
+ |
+ test('FutureOr', () => { |
+ let f = Future(dart.dynamic).value(42); |
+ let l = [1, 2, 3]; |
+ |
+ assert.throws(() => { dart.as(f, FutureOr(core.int)); }); |
+ assert.throws(() => { dart.as(l, FutureOr(List(core.int)))}); |
+ |
+ dart_sdk.dart.ignoreWhitelistedErrors(true); |
+ assert.equal(f, dart.as(f, FutureOr(core.int))); |
+ assert.equal(l, dart.as(l, FutureOr(List(core.int)))); |
+ }); |
+ }); |
suite('generic', () => { |
"use strict"; |