| 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 "dart:_js_helper"; |
| 5 import "package:expect/expect.dart"; | 6 import "package:expect/expect.dart"; |
| 6 | 7 |
| 7 // Test that type checks occur on assignment to fields of native methods. | 8 // Test that type checks occur on assignment to fields of native methods. |
| 8 | 9 |
| 9 class A native "A" { | 10 @Native("A") |
| 11 class A { |
| 10 int foo; | 12 int foo; |
| 11 } | 13 } |
| 12 | 14 |
| 13 class B native "B" { | 15 @Native("B") |
| 16 class B { |
| 14 String foo; | 17 String foo; |
| 15 } | 18 } |
| 16 | 19 |
| 17 A makeA() native { return new A(); } | 20 A makeA() native { return new A(); } |
| 18 B makeB() native { return new B(); } | 21 B makeB() native { return new B(); } |
| 19 | 22 |
| 20 void setup() native """ | 23 void setup() native """ |
| 21 function A() {} | 24 function A() {} |
| 22 | 25 |
| 23 function B() {} | 26 function B() {} |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 | 110 |
| 108 main() { | 111 main() { |
| 109 setup(); | 112 setup(); |
| 110 | 113 |
| 111 if (isCheckedMode()) { | 114 if (isCheckedMode()) { |
| 112 checkedModeTest(); | 115 checkedModeTest(); |
| 113 } else { | 116 } else { |
| 114 uncheckedModeTest(); | 117 uncheckedModeTest(); |
| 115 } | 118 } |
| 116 } | 119 } |
| OLD | NEW |