| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 import 'package:expect/expect.dart'; | 5 import 'package:expect/expect.dart'; |
| 6 import "package:async_helper/async_helper.dart"; | 6 import "package:async_helper/async_helper.dart"; |
| 7 import 'compiler_helper.dart'; | 7 import 'compiler_helper.dart'; |
| 8 | 8 |
| 9 dummyImplTest() { | 9 dummyImplTest() { |
| 10 String source = """ | 10 String source = """ |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 var compiler = compilerFor(source, uri); | 202 var compiler = compilerFor(source, uri); |
| 203 asyncTest(() => compiler.runCompiler(uri).then((_) { | 203 asyncTest(() => compiler.runCompiler(uri).then((_) { |
| 204 Expect.isTrue(compiler.backend.enabledNoSuchMethod); | 204 Expect.isTrue(compiler.backend.enabledNoSuchMethod); |
| 205 ClassElement clsA = findElement(compiler, 'A'); | 205 ClassElement clsA = findElement(compiler, 'A'); |
| 206 Expect.isTrue( | 206 Expect.isTrue( |
| 207 compiler.backend.noSuchMethodRegistry.otherImpls.contains( | 207 compiler.backend.noSuchMethodRegistry.otherImpls.contains( |
| 208 clsA.lookupMember('noSuchMethod'))); | 208 clsA.lookupMember('noSuchMethod'))); |
| 209 })); | 209 })); |
| 210 } | 210 } |
| 211 | 211 |
| 212 dummyImplTest10() { |
| 213 String source = """ |
| 214 class A { |
| 215 noSuchMethod(Invocation x) { |
| 216 throw new UnsupportedException(); |
| 217 } |
| 218 } |
| 219 main() { |
| 220 print(new A().foo()); |
| 221 } |
| 222 """; |
| 223 Uri uri = new Uri(scheme: 'source'); |
| 224 var compiler = compilerFor(source, uri); |
| 225 asyncTest(() => compiler.runCompiler(uri).then((_) { |
| 226 Expect.isTrue(compiler.backend.enabledNoSuchMethod); |
| 227 ClassElement clsA = findElement(compiler, 'A'); |
| 228 Expect.isTrue( |
| 229 compiler.backend.noSuchMethodRegistry.throwingImpls.contains( |
| 230 clsA.lookupMember('noSuchMethod'))); |
| 231 })); |
| 232 } |
| 233 |
| 212 main() { | 234 main() { |
| 213 dummyImplTest(); | 235 dummyImplTest(); |
| 214 dummyImplTest2(); | 236 dummyImplTest2(); |
| 215 dummyImplTest3(); | 237 dummyImplTest3(); |
| 216 dummyImplTest4(); | 238 dummyImplTest4(); |
| 217 dummyImplTest5(); | 239 dummyImplTest5(); |
| 218 dummyImplTest6(); | 240 dummyImplTest6(); |
| 219 dummyImplTest7(); | 241 dummyImplTest7(); |
| 220 dummyImplTest8(); | 242 dummyImplTest8(); |
| 221 dummyImplTest9(); | 243 dummyImplTest9(); |
| 244 dummyImplTest10(); |
| 222 } | 245 } |
| OLD | NEW |