Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(215)

Unified Diff: tests/language/invocation_mirror_empty_arguments_test.dart

Issue 1359503002: Spec says empty namedArguments is const {}, not const <Symbol, dynamic>{}. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/lib/invocation_mirror_patch.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language/invocation_mirror_empty_arguments_test.dart
diff --git a/tests/language/invocation_mirror_empty_arguments_test.dart b/tests/language/invocation_mirror_empty_arguments_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..8212536404960d6b66611e76644b70e29110aad4
--- /dev/null
+++ b/tests/language/invocation_mirror_empty_arguments_test.dart
@@ -0,0 +1,46 @@
+// 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.
+}
« no previous file with comments | « runtime/lib/invocation_mirror_patch.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698