| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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:mirrors" show reflect; | 5 import "dart:mirrors" show reflect; |
| 6 import "package:expect/expect.dart"; | 6 import "package:expect/expect.dart"; |
| 7 | 7 |
| 8 class GetName { | 8 class GetName { |
| 9 foo(x, y, [z]) => "foo"; | 9 foo(x, y, [z]) => "foo"; |
| 10 } | 10 } |
| 11 | 11 |
| 12 String getName(im) => reflect(new GetName()).delegate(im); | 12 String getName(im) => reflect(new GetName()).delegate(im); |
| 13 | 13 |
| 14 class A native "*A" { | 14 class A native "A" { |
| 15 bar() => 42; | 15 bar() => 42; |
| 16 } | 16 } |
| 17 | 17 |
| 18 class B native "*B" { | 18 class B native "B" { |
| 19 foo() => 42; | 19 foo() => 42; |
| 20 } | 20 } |
| 21 | 21 |
| 22 class C { | 22 class C { |
| 23 static create() => new C(); | 23 static create() => new C(); |
| 24 noSuchMethod(x) => "${getName(x)}:${x.positionalArguments}"; | 24 noSuchMethod(x) => "${getName(x)}:${x.positionalArguments}"; |
| 25 } | 25 } |
| 26 | 26 |
| 27 makeA() native; | 27 makeA() native; |
| 28 | 28 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 39 try { | 39 try { |
| 40 a.foo(); | 40 a.foo(); |
| 41 } on NoSuchMethodError catch (e) { | 41 } on NoSuchMethodError catch (e) { |
| 42 exception = e; | 42 exception = e; |
| 43 } | 43 } |
| 44 Expect.isNotNull(exception); | 44 Expect.isNotNull(exception); |
| 45 var c = C.create(); | 45 var c = C.create(); |
| 46 Expect.equals("foo:[1, 2]", c.foo(1, 2)); | 46 Expect.equals("foo:[1, 2]", c.foo(1, 2)); |
| 47 Expect.equals("foo:[3, 4, 5]", c.foo(3, 4, 5)); | 47 Expect.equals("foo:[3, 4, 5]", c.foo(3, 4, 5)); |
| 48 } | 48 } |
| OLD | NEW |