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

Unified Diff: tests/language/naming3_test.dart

Issue 10310060: Generate getters and setters dynamically. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Simplify by using a bool. Created 8 years, 7 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
Index: tests/language/naming3_test.dart
diff --git a/tests/language/naming3_test.dart b/tests/language/naming3_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..d045fff84a4fa773b946051f2565c5b8c4e72533
--- /dev/null
+++ b/tests/language/naming3_test.dart
@@ -0,0 +1,35 @@
+// Copyright (c) 2012, 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.
+
+class A {
+ var __PROTO__ = 499;
+ var constructor = 1;
+ var prototype = 2;
+}
+
+class B extends A {
+ get __PROTO__() => 42;
+ get constructor() => 3;
+ get prototype() => 4;
+}
+
+main() {
+ var a = new A();
+ var b = new B();
+ var list = [a, b];
+ for (int i = 0; i < list.length; i++) {
+ var proto = list[i].__PROTO__;
+ var constructor = list[i].constructor;
+ var prototype = list[i].prototype;
+ if (i == 0) {
+ Expect.equals(499, proto);
+ Expect.equals(1, constructor);
+ Expect.equals(2, prototype);
+ } else {
+ Expect.equals(42, proto);
+ Expect.equals(3, constructor);
+ Expect.equals(4, prototype);
+ }
+ }
+}
« lib/compiler/implementation/emitter.dart ('K') | « lib/compiler/implementation/native_emitter.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698