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

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

Issue 2616933003: Ensure we're looking at the correct resolved AST when initializing fields in constructors. (Closed)
Patch Set: dartfmt Created 3 years, 11 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: tests/compiler/dart2js/kernel/constructors_test.dart
diff --git a/tests/compiler/dart2js/kernel/constructors_test.dart b/tests/compiler/dart2js/kernel/constructors_test.dart
index ba38190007bc9453e3b42c892a9b7d3ae36fec57..d0de116ec5546f6be7b3f9a1fa8227b472e6f02e 100644
--- a/tests/compiler/dart2js/kernel/constructors_test.dart
+++ b/tests/compiler/dart2js/kernel/constructors_test.dart
@@ -46,8 +46,29 @@ main() => new Foo(number: 3);
''';
return check(code, lookup: defaultConstructorFor('Foo'));
});
+
+ // TODO(efortuna): Kernel needs to have some additional constructor
+ // implementaion work before this is legitimately equivalent code to the
+ // original AST.
+ /*test('initialized field and constructor', () {
+ String code = '''
+import 'dart:_foreign_helper' show JS, JS_EMBEDDED_GLOBAL;
+import 'package:expect/expect.dart';
+
+
+class Foo {
+ final value = JS('bool', '#()', JS_EMBEDDED_GLOBAL('', 'foo'));
+ Foo() {
+ print('hello world');
+ }
}
+main() => new Foo();
+''';
+ return check(code, lookup: defaultConstructorFor('Foo'));
+ });
+}*/
+
defaultConstructorFor(String className) => (Compiler compiler) {
ClassElement clazz = compiler.mainApp.find(className);
return clazz.lookupDefaultConstructor();

Powered by Google App Engine
This is Rietveld 408576698