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

Unified Diff: lib/src/codegen/js_codegen.dart

Issue 1122883002: Do not suppress implicit constructors that need a super call. (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 8 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 | « lib/runtime/dart/core.js ('k') | test/codegen/expect/cascade.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/codegen/js_codegen.dart
diff --git a/lib/src/codegen/js_codegen.dart b/lib/src/codegen/js_codegen.dart
index 6c1ba46e5897bfc3447955762756f777dbff9bb3..27432968b2178b751f8e78f047a369b9838c3011 100644
--- a/lib/src/codegen/js_codegen.dart
+++ b/lib/src/codegen/js_codegen.dart
@@ -682,10 +682,10 @@ class JSCodegenVisitor extends GeneralizingAstVisitor with ConversionVisitor {
assert(_hasUnnamedConstructor(node.element) == fields.isNotEmpty);
// If we don't have a method body, skip this.
- if (fields.isEmpty) return null;
+ var superCall = _superConstructorCall(node);
+ if (fields.isEmpty && superCall == null) return null;
dynamic body = _initializeFields(fields);
- var superCall = _superConstructorCall(node);
if (superCall != null) body = [[body, superCall]];
return new JS.Method(
_propertyName(name), js.call('function() { #; }', body));
« no previous file with comments | « lib/runtime/dart/core.js ('k') | test/codegen/expect/cascade.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698