| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 library test.invoke_import_test; | 5 library test.invoke_import_test; |
| 6 | 6 |
| 7 import 'dart:mirrors'; | 7 import 'dart:mirrors'; |
| 8 import 'package:expect/expect.dart'; | 8 import 'package:expect/expect.dart'; |
| 9 | 9 |
| 10 import 'other_library.dart'; | 10 import 'other_library.dart'; |
| 11 | 11 |
| 12 main() { | 12 main() { |
| 13 LibraryMirror thisLibrary = | 13 LibraryMirror thisLibrary = |
| 14 currentMirrorSystem().findLibrary(#test.invoke_import_test).single; | 14 currentMirrorSystem().findLibrary(#test.invoke_import_test); |
| 15 | 15 |
| 16 Expect.throws(() => thisLibrary.invoke(#topLevelMethod, []), | 16 Expect.throws(() => thisLibrary.invoke(#topLevelMethod, []), |
| 17 (e) => e is NoSuchMethodError, | 17 (e) => e is NoSuchMethodError, |
| 18 'Should not invoke imported method #topLevelMethod'); | 18 'Should not invoke imported method #topLevelMethod'); |
| 19 | 19 |
| 20 Expect.throws(() => thisLibrary.getField(#topLevelGetter), | 20 Expect.throws(() => thisLibrary.getField(#topLevelGetter), |
| 21 (e) => e is NoSuchMethodError, | 21 (e) => e is NoSuchMethodError, |
| 22 'Should not invoke imported getter #topLevelGetter'); | 22 'Should not invoke imported getter #topLevelGetter'); |
| 23 | 23 |
| 24 Expect.throws(() => thisLibrary.getField(#topLevelField), | 24 Expect.throws(() => thisLibrary.getField(#topLevelField), |
| 25 (e) => e is NoSuchMethodError, | 25 (e) => e is NoSuchMethodError, |
| 26 'Should not invoke imported field #topLevelField'); | 26 'Should not invoke imported field #topLevelField'); |
| 27 | 27 |
| 28 Expect.throws(() => thisLibrary.setField(#topLevelSetter, 23), | 28 Expect.throws(() => thisLibrary.setField(#topLevelSetter, 23), |
| 29 (e) => e is NoSuchMethodError, | 29 (e) => e is NoSuchMethodError, |
| 30 'Should not invoke imported setter #topLevelSetter'); | 30 'Should not invoke imported setter #topLevelSetter'); |
| 31 | 31 |
| 32 Expect.throws(() => thisLibrary.setField(#topLevelField, 23), | 32 Expect.throws(() => thisLibrary.setField(#topLevelField, 23), |
| 33 (e) => e is NoSuchMethodError, | 33 (e) => e is NoSuchMethodError, |
| 34 'Should not invoke imported field #topLevelField'); | 34 'Should not invoke imported field #topLevelField'); |
| 35 } | 35 } |
| OLD | NEW |