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

Unified Diff: tests/language/src/PseudoKWTest.dart

Issue 9107070: Proper handling of built-in identifiers (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 8 years, 11 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 | « tests/language/src/NamingTest.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language/src/PseudoKWTest.dart
===================================================================
--- tests/language/src/PseudoKWTest.dart (revision 3300)
+++ tests/language/src/PseudoKWTest.dart (working copy)
@@ -49,7 +49,52 @@
}
}
+typedef(x) => "typedef " + x;
+static(abstract) {
+ return abstract == true;
+}
+
+class A {
+ var typedef = 0;
+ set(x) { typedef = x; }
+ get() => typedef - 5;
+
+ static static() {
+ return 1;
+ }
+ static check() {
+ var o = new A();
+ o.set(55);
+ Expect.equals(50, o.get());
+ static();
+ }
+}
+
+class B {
+ var set = 100;
+ get get() => set;
+ set get(get) => set = 2 * get.get;
+
+ static() {
+ var set = new B();
+ set.get = set;
+ Expect.equals(200, set.get);
+ }
+ int operator() {
+ return 1;
+ }
+}
+
+
main() {
PseudoKWTest.testMain();
+ A.check();
+ new B().static();
+ Expect.equals(1, new B().operator());
+ Expect.equals(1, A.static());
+ typedef("T");
+ Expect.equals("typedef T", typedef("T"));
+ static("true");
+ Expect.equals(false, static("true"));
}
« no previous file with comments | « tests/language/src/NamingTest.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698