OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
| 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. |
| 4 |
| 5 import "package:expect/expect.dart"; |
| 6 |
| 7 class Getter { |
| 8 noSuchMethod(invocation) { |
| 9 Expect.isTrue(invocation.isGetter); |
| 10 Expect.identical(const [], invocation.positionalArguments); |
| 11 Expect.identical(const {}, invocation.namedArguments); |
| 12 } |
| 13 } |
| 14 |
| 15 class Setter { |
| 16 noSuchMethod(invocation) { |
| 17 Expect.isTrue(invocation.isSetter); |
| 18 Expect.identical(const {}, invocation.namedArguments); |
| 19 } |
| 20 } |
| 21 |
| 22 class Method { |
| 23 noSuchMethod(invocation) { |
| 24 Expect.isTrue(invocation.isMethod); |
| 25 Expect.identical(const [], invocation.positionalArguments); |
| 26 Expect.identical(const {}, invocation.namedArguments); |
| 27 } |
| 28 } |
| 29 |
| 30 class Operator { |
| 31 noSuchMethod(invocation) { |
| 32 Expect.isTrue(invocation.isMethod); |
| 33 Expect.identical(const {}, invocation.namedArguments); |
| 34 } |
| 35 } |
| 36 |
| 37 main() { |
| 38 var g = new Getter(); |
| 39 print(g.getterThatDoesNotExist); |
| 40 var s = new Setter(); |
| 41 print(s.setterThatDoesNotExist = 42); |
| 42 var m = new Method(); |
| 43 print(m.methodThatDoesNotExist()); |
| 44 var o = new Operator(); |
| 45 print(o + 42); // Operator that does not exist. |
| 46 } |
OLD | NEW |