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

Unified Diff: tests/compiler/dart2js/kernel/getters_setters_test.dart

Issue 2672063003: Implement SuperPropertySet and SuperNoSuchMethod. (Closed)
Patch Set: . Created 3 years, 10 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 | « pkg/compiler/lib/src/ssa/kernel_ast_adapter.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/kernel/getters_setters_test.dart
diff --git a/tests/compiler/dart2js/kernel/getters_setters_test.dart b/tests/compiler/dart2js/kernel/getters_setters_test.dart
index e6e608373529f1f2cf7f6dd01609b7d7df9c41f5..d732ad2830713f51d3f54e4327deeb9f70b9b794 100644
--- a/tests/compiler/dart2js/kernel/getters_setters_test.dart
+++ b/tests/compiler/dart2js/kernel/getters_setters_test.dart
@@ -25,6 +25,39 @@ main() => A.foo;
''';
return check(code);
});
+
+ test('super get', () {
+ String code = '''
+class A {
+ int get foo => 1;
+}
+
+class B extends A {
+
+ int get rotations => super.foo * 3;
+}
+
+main() => new B().foo;
+''';
+ return check(code);
+ });
+
+ test('super get no such method', () {
+ String code = '''
+class A {
+ static int get foo => 1;
+}
+
+class B extends A {
+
+ int get rotations => super.nothing * 3;
+}
+
+main() => new B().foo;
+''';
+ return check(code);
+ });
+
});
group('compile setters with kernel', () {
@@ -53,4 +86,39 @@ main() {
return check(code);
});
});
+
+ test('super set', () {
+ String code = '''
+class A {
+ set ferocious(int newFerocious) {}
+}
+
+class B extends A {
+ bar() {
+ super.ferocious = 87;
+ }
+}
+main() {
+ new B().bar();
+}''';
+ return check(code);
+ });
+
+ test('super set no such method', () {
+ String code = '''
+class A {
+ final ferocious = 0;
+ noSuchMethod(_) => 42;
+}
+
+class B extends A {
+ bar() {
+ super.ferocious = 87;
+ }
+}
+main() {
+ new B().bar();
+}''';
+ return check(code);
+ });
}
« no previous file with comments | « pkg/compiler/lib/src/ssa/kernel_ast_adapter.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698