OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 // Test to see if resolving a hidden native class's method to noSuchMethod | 5 // Test to see if resolving a hidden native class's method to noSuchMethod |
6 // interferes with subsequent resolving of the method. This might happen if the | 6 // interferes with subsequent resolving of the method. This might happen if the |
7 // noSuchMethod is cached on Object.prototype. | 7 // noSuchMethod is cached on Object.prototype. |
8 | 8 |
| 9 import "package:expect/expect.dart"; |
9 import 'native_metadata.dart'; | 10 import 'native_metadata.dart'; |
10 | 11 |
11 @Native("*A1") | 12 @Native("*A1") |
12 class A1 { | 13 class A1 { |
13 } | 14 } |
14 | 15 |
15 @Native("*B1") | 16 @Native("*B1") |
16 class B1 extends A1 { | 17 class B1 extends A1 { |
17 } | 18 } |
18 | 19 |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 expectNoSuchMethod(action, note) { | 96 expectNoSuchMethod(action, note) { |
96 bool caught = false; | 97 bool caught = false; |
97 try { | 98 try { |
98 action(); | 99 action(); |
99 } catch (ex) { | 100 } catch (ex) { |
100 caught = true; | 101 caught = true; |
101 Expect.isTrue(ex is NoSuchMethodError, note); | 102 Expect.isTrue(ex is NoSuchMethodError, note); |
102 } | 103 } |
103 Expect.isTrue(caught, note); | 104 Expect.isTrue(caught, note); |
104 } | 105 } |
OLD | NEW |