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

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

Issue 2353793002: kernel->ssa: implement top-level getters and setters (Closed)
Patch Set: extract common subexpression Created 4 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 | « pkg/compiler/lib/src/ssa/builder_kernel.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
new file mode 100644
index 0000000000000000000000000000000000000000..e6e608373529f1f2cf7f6dd01609b7d7df9c41f5
--- /dev/null
+++ b/tests/compiler/dart2js/kernel/getters_setters_test.dart
@@ -0,0 +1,56 @@
+// Copyright (c) 2016, 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:test/test.dart';
+
+import 'helper.dart' show check;
+
+main() {
+ group('compile getters with kernel', () {
+ test('top-level', () {
+ String code = '''
+int get foo => 1;
+main() => foo;
+''';
+ return check(code);
+ });
+
+ test('static', () {
+ String code = '''
+class A {
+ static int get foo => 1;
+}
+main() => A.foo;
+''';
+ return check(code);
+ });
+ });
+
+ group('compile setters with kernel', () {
+ test('top-level', () {
+ String code = '''
+set foo(int newFoo) {
+ // do nothing
+}
+main() {
+ foo = 1;
+}''';
+ return check(code);
+ });
+
+ test('static', () {
+ String code = '''
+class A {
+ static set foo(int newFoo) {
+ // do nothing
+ }
+}
+main() {
+ A.foo = 1;
+}
+''';
+ return check(code);
+ });
+ });
+}
« no previous file with comments | « pkg/compiler/lib/src/ssa/builder_kernel.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698