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 import "package:expect/expect.dart"; |
| 6 |
5 // Test to see if resolving a hidden native class's method to noSuchMethod | 7 // 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 | 8 // interferes with subsequent resolving of the method. This might happen if the |
7 // noSuchMethod is cached on Object.prototype. | 9 // noSuchMethod is cached on Object.prototype. |
8 | 10 |
9 class A1 native "*A1" { | 11 class A1 native "*A1" { |
10 } | 12 } |
11 | 13 |
12 class B1 extends A1 native "*B1" { | 14 class B1 extends A1 native "*B1" { |
13 } | 15 } |
14 | 16 |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 expectNoSuchMethod(action, note) { | 90 expectNoSuchMethod(action, note) { |
89 bool caught = false; | 91 bool caught = false; |
90 try { | 92 try { |
91 action(); | 93 action(); |
92 } catch (ex) { | 94 } catch (ex) { |
93 caught = true; | 95 caught = true; |
94 Expect.isTrue(ex is NoSuchMethodError, note); | 96 Expect.isTrue(ex is NoSuchMethodError, note); |
95 } | 97 } |
96 Expect.isTrue(caught, note); | 98 Expect.isTrue(caught, note); |
97 } | 99 } |
OLD | NEW |