| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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"; | 5 import "package:expect/expect.dart"; |
| 6 | 6 |
| 7 // Test that native classes and ordinary Dart classes can both use the same | 7 // Test that native classes and ordinary Dart classes can both use the same |
| 8 // ordinary Dart classes as a mixin. | 8 // ordinary Dart classes as a mixin. |
| 9 | 9 |
| 10 class A native "*A" { | 10 class A native "A" { |
| 11 final String aa; | 11 final String aa; |
| 12 foo() => "A-foo $aa"; | 12 foo() => "A-foo $aa"; |
| 13 baz() => "A-baz $aa"; | 13 baz() => "A-baz $aa"; |
| 14 } | 14 } |
| 15 | 15 |
| 16 class B extends A with M native "*B" { | 16 class B extends A with M native "B" { |
| 17 bar() => 'B-bar -> ${baz()}'; | 17 bar() => 'B-bar -> ${baz()}'; |
| 18 get mm => 'B.mm($aa)'; | 18 get mm => 'B.mm($aa)'; |
| 19 } | 19 } |
| 20 | 20 |
| 21 class M { | 21 class M { |
| 22 foo() => "M-foo ${this.mm}"; | 22 foo() => "M-foo ${this.mm}"; |
| 23 bar() => "M-bar ${this.mm}"; | 23 bar() => "M-bar ${this.mm}"; |
| 24 get mm => 'M.mm'; | 24 get mm => 'M.mm'; |
| 25 } | 25 } |
| 26 | 26 |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 Expect.equals("M-foo D.mm(cc)", d.foo()); | 96 Expect.equals("M-foo D.mm(cc)", d.foo()); |
| 97 Expect.equals("D-bar -> C-baz cc", d.bar()); | 97 Expect.equals("D-bar -> C-baz cc", d.bar()); |
| 98 Expect.equals("C-baz cc", d.baz()); | 98 Expect.equals("C-baz cc", d.baz()); |
| 99 Expect.isFalse(d is A); | 99 Expect.isFalse(d is A); |
| 100 Expect.isFalse(d is B); | 100 Expect.isFalse(d is B); |
| 101 Expect.isTrue(d is C); | 101 Expect.isTrue(d is C); |
| 102 Expect.isTrue(d is D); | 102 Expect.isTrue(d is D); |
| 103 Expect.isTrue(d is M); | 103 Expect.isTrue(d is M); |
| 104 | 104 |
| 105 } | 105 } |
| OLD | NEW |