| 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 class NoSuchMethodInfo { | 5 class NoSuchMethodInfo { |
| 6 Object receiver; | 6 Object receiver; |
| 7 String name; | 7 String name; |
| 8 List args; | 8 List args; |
| 9 NoSuchMethodInfo(Object r, String m, List a) | 9 NoSuchMethodInfo(Object r, String m, List a) |
| 10 : receiver = r, name = m, args = a; | 10 : receiver = r, name = m, args = a; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 } | 23 } |
| 24 | 24 |
| 25 // Used for the setter case. | 25 // Used for the setter case. |
| 26 NoSuchMethodInfo topLevelInfo; | 26 NoSuchMethodInfo topLevelInfo; |
| 27 | 27 |
| 28 main() { | 28 main() { |
| 29 A a = new A(); | 29 A a = new A(); |
| 30 var info = a.foo(); | 30 var info = a.foo(); |
| 31 Expect.equals('foo', info.name); | 31 Expect.equals('foo', info.name); |
| 32 Expect.isTrue(info.args.isEmpty); | 32 Expect.isTrue(info.args.isEmpty); |
| 33 Expect.isTrue(info.receiver === a); | 33 Expect.isTrue(identical(info.receiver, a)); |
| 34 | 34 |
| 35 info = a.foo(2); | 35 info = a.foo(2); |
| 36 Expect.equals('foo', info.name); | 36 Expect.equals('foo', info.name); |
| 37 Expect.isTrue(info.args.length == 1); | 37 Expect.isTrue(info.args.length == 1); |
| 38 Expect.isTrue(info.args[0] === 2); | 38 Expect.isTrue(info.args[0] == 2); |
| 39 Expect.isTrue(info.receiver === a); | 39 Expect.isTrue(identical(info.receiver, a)); |
| 40 | 40 |
| 41 info = a.bar; | 41 info = a.bar; |
| 42 Expect.equals('bar', info.name); | 42 Expect.equals('bar', info.name); |
| 43 Expect.isTrue(info.args.length == 0); | 43 Expect.isTrue(info.args.length == 0); |
| 44 Expect.isTrue(info.receiver === a); | 44 Expect.isTrue(identical(info.receiver, a)); |
| 45 | 45 |
| 46 a.bar = 2; | 46 a.bar = 2; |
| 47 info = topLevelInfo; | 47 info = topLevelInfo; |
| 48 Expect.equals('bar', info.name); | 48 Expect.equals('bar', info.name); |
| 49 Expect.isTrue(info.args.length == 1); | 49 Expect.isTrue(info.args.length == 1); |
| 50 Expect.isTrue(info.args[0] === 2); | 50 Expect.isTrue(info.args[0] == 2); |
| 51 Expect.isTrue(info.receiver === a); | 51 Expect.isTrue(identical(info.receiver, a)); |
| 52 } | 52 } |
| OLD | NEW |