mirror of
https://github.com/dart-lang/sdk
synced 2024-09-18 20:51:19 +00:00
5ee2da4475
BUG=http://dartbug.com/24331 R=gbracha@google.com Review URL: https://codereview.chromium.org//1359503002 .
47 lines
1.2 KiB
Dart
47 lines
1.2 KiB
Dart
// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
|
|
// for details. All rights reserved. Use of this source code is governed by a
|
|
// BSD-style license that can be found in the LICENSE file.
|
|
|
|
import "package:expect/expect.dart";
|
|
|
|
class Getter {
|
|
noSuchMethod(invocation) {
|
|
Expect.isTrue(invocation.isGetter);
|
|
Expect.identical(const [], invocation.positionalArguments);
|
|
Expect.identical(const {}, invocation.namedArguments);
|
|
}
|
|
}
|
|
|
|
class Setter {
|
|
noSuchMethod(invocation) {
|
|
Expect.isTrue(invocation.isSetter);
|
|
Expect.identical(const {}, invocation.namedArguments);
|
|
}
|
|
}
|
|
|
|
class Method {
|
|
noSuchMethod(invocation) {
|
|
Expect.isTrue(invocation.isMethod);
|
|
Expect.identical(const [], invocation.positionalArguments);
|
|
Expect.identical(const {}, invocation.namedArguments);
|
|
}
|
|
}
|
|
|
|
class Operator {
|
|
noSuchMethod(invocation) {
|
|
Expect.isTrue(invocation.isMethod);
|
|
Expect.identical(const {}, invocation.namedArguments);
|
|
}
|
|
}
|
|
|
|
main() {
|
|
var g = new Getter();
|
|
print(g.getterThatDoesNotExist);
|
|
var s = new Setter();
|
|
print(s.setterThatDoesNotExist = 42);
|
|
var m = new Method();
|
|
print(m.methodThatDoesNotExist());
|
|
var o = new Operator();
|
|
print(o + 42); // Operator that does not exist.
|
|
}
|