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

Unified Diff: pkg/kernel/testcases/interpreter/object_initializers_test.dart

Issue 2985883002: Add support for field initialization in objects (Closed)
Patch Set: Fix too long line Created 3 years, 5 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: pkg/kernel/testcases/interpreter/object_initializers_test.dart
diff --git a/pkg/kernel/testcases/interpreter/object_initializers_test.dart b/pkg/kernel/testcases/interpreter/object_initializers_test.dart
deleted file mode 100644
index 725df4b5941be42dc625d7b4e79bf13d61cfd953..0000000000000000000000000000000000000000
--- a/pkg/kernel/testcases/interpreter/object_initializers_test.dart
+++ /dev/null
@@ -1,39 +0,0 @@
-// Copyright (c) 2017, 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.
-
-library object_initializers_test;
-
-/// Simple program creating an object with field initializers.
-void main() {
- var a = new A('foo1', 'foo2');
- print(a.foo1);
- print(a.foo2);
-
- var b = new B(fieldInitializer(0, 'foo1'), fieldInitializer(0, 'foo2'));
- print(b.foo1);
- print(b.foo2);
- print(b.foo3);
-}
-
-class A {
- String foo1;
- String foo2;
-
- A(String foo1, String foo2)
- : foo1 = foo1,
- foo2 = foo2;
-}
-
-class B {
- String foo1 = fieldInitializer(1, 'foo1');
- String foo2 = fieldInitializer(1, 'foo2');
- String foo3 = fieldInitializer(1, 'foo3');
-
- B(this.foo1, this.foo2) : foo3 = foo2;
-}
-
-String fieldInitializer(int f, String s) {
- print('$s: $f');
- return '$s: $f';
-}

Powered by Google App Engine
This is Rietveld 408576698