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"; | |
10 import 'native_metadata.dart'; | 9 import 'native_metadata.dart'; |
11 | 10 |
12 @Native("*A1") | 11 @Native("*A1") |
13 class A1 { | 12 class A1 { |
14 } | 13 } |
15 | 14 |
16 @Native("*B1") | 15 @Native("*B1") |
17 class B1 extends A1 { | 16 class B1 extends A1 { |
18 } | 17 } |
19 | 18 |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 expectNoSuchMethod(action, note) { | 95 expectNoSuchMethod(action, note) { |
97 bool caught = false; | 96 bool caught = false; |
98 try { | 97 try { |
99 action(); | 98 action(); |
100 } catch (ex) { | 99 } catch (ex) { |
101 caught = true; | 100 caught = true; |
102 Expect.isTrue(ex is NoSuchMethodError, note); | 101 Expect.isTrue(ex is NoSuchMethodError, note); |
103 } | 102 } |
104 Expect.isTrue(caught, note); | 103 Expect.isTrue(caught, note); |
105 } | 104 } |
OLD | NEW |