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

Side by Side Diff: tests/compiler/dart2js/kernel/constructors_test.dart

Issue 2498493003: kernel->ssa: get simple constructors working (Closed)
Patch Set: Created 4 years, 1 month 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4
5 import 'package:compiler/src/compiler.dart' show Compiler;
6 import 'package:test/test.dart';
7
8 import 'helper.dart' show check;
9
10 main() {
11 test('simple default constructor', () {
12 String code = '''
13 class A {
14 }
15
16 main() {
17 var a = new A();
18 return a;
19 }''';
20 return check(code, checkElement: (Compiler compiler) {
Siggi Cherem (dart-lang) 2016/11/14 18:22:25 nit: consider defining a helper function for this
Harry Terkelsen 2016/11/14 23:23:40 Done.
21 ClassElement a = compiler.mainApp.find('A');
22 return a.lookupDefaultConstructor();
23 });
24 });
25
26 test('simple default constructor with field', () {
27 String code = '''
28 class A {
29 int x = 1;
30 }
31
32 main() {
33 var a = new A();
34 return a;
35 }''';
36 return check(code, checkElement: (Compiler compiler) {
37 ClassElement a = compiler.mainApp.find('A');
38 return a.lookupDefaultConstructor();
39 });
40 });
41 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698