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

Unified Diff: tests/language/generic_object_type_test.dart

Issue 802653005: dart2js: put all type-test related properties on the prototype and not on the constructor. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add workaround for non-existing classes. Created 6 years 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/corelib/safe_to_string_test.dart ('k') | tests/language/mixin_only_for_rti_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language/generic_object_type_test.dart
diff --git a/tests/language/rewrite_assign_test.dart b/tests/language/generic_object_type_test.dart
similarity index 56%
copy from tests/language/rewrite_assign_test.dart
copy to tests/language/generic_object_type_test.dart
index 5379a6ca35bf171a8d2f276529597b1355e26a57..4b1733a63a3eb4240d5b26b17257629968b0b548 100644
--- a/tests/language/rewrite_assign_test.dart
+++ b/tests/language/generic_object_type_test.dart
@@ -4,23 +4,13 @@
import "package:expect/expect.dart";
-bar(x,y) {}
-
-foo(b) {
- var x, y;
- if (b) {
- x = 1;
- y = 2;
- } else {
- x = 2;
- y = 1;
+class Tester<T> {
+ testGenericType(x) {
+ return x is T;
}
- bar(x,y);
- bar(x,y);
- return x;
}
main() {
- Expect.equals(1, foo(true));
- Expect.equals(2, foo(false));
+ // The Dart Object type is special in that it doesn't have any superclass.
+ Expect.isTrue(new Tester<Object>().testGenericType(new Object()));
}
« no previous file with comments | « tests/corelib/safe_to_string_test.dart ('k') | tests/language/mixin_only_for_rti_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698