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 that type checks occur on native methods. | 5 // Test that type checks occur on native methods. |
6 | 6 |
7 @native("*A") | 7 @native("*A") |
8 class A { | 8 class A { |
9 @native int foo(int x); | 9 @native int foo(int x); |
10 @native int cmp(A other); | 10 @native int cmp(A other); |
11 } | 11 } |
12 | 12 |
13 @native("*B") | 13 @native("*B") |
14 class B { | 14 class B { |
15 @native String foo(String x); | 15 @native String foo(String x); |
16 @native int cmp(B other); | 16 @native int cmp(B other); |
17 } | 17 } |
18 | 18 |
19 @native A makeA() { return new A(); } | 19 @native A makeA() { return new A(); } |
20 @native B makeB() { return new B(); } | 20 @native B makeB() { return new B(); } |
21 | 21 |
22 @native(""" | 22 @native(""" |
23 function A() {} | 23 function A() {} |
24 A.prototype.foo = function (x) { return x + 1; }; | 24 A.prototype.foo = function (x) { return x + 1; }; |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 | 134 |
135 main() { | 135 main() { |
136 setup(); | 136 setup(); |
137 | 137 |
138 if (isCheckedMode()) { | 138 if (isCheckedMode()) { |
139 checkedModeTest(); | 139 checkedModeTest(); |
140 } else { | 140 } else { |
141 uncheckedModeTest(); | 141 uncheckedModeTest(); |
142 } | 142 } |
143 } | 143 } |
OLD | NEW |