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