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

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

Issue 2984903002: Add support for running constructors with new (Closed)
Patch Set: Update todos in code 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/constructor_simple_test.dart
diff --git a/pkg/kernel/testcases/interpreter/constructor_simple_test.dart b/pkg/kernel/testcases/interpreter/constructor_simple_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..f1a074b122bb56d5d1dab9e08b710206b24131ef
--- /dev/null
+++ b/pkg/kernel/testcases/interpreter/constructor_simple_test.dart
@@ -0,0 +1,21 @@
+// 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.
+
+/// Test program that creates an object by invoking a constor without
+/// initializers.
+main() {
+ var objA = new A(37, 'test');
+ print(objA.a);
+ print(objA.b);
+}
+
+class A {
+ int a;
+ String b;
+
+ A(int a, String b) {
+ this.a = a;
+ this.b = b;
+ }
+}
« no previous file with comments | « pkg/kernel/lib/interpreter/interpreter.dart ('k') | pkg/kernel/testcases/interpreter/constructor_simple_test.dart.expect » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698