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

Unified Diff: pkg/compiler/lib/src/cps_ir/cps_ir_builder_visitor.dart

Issue 900403003: Support default constructors in analyzer2dart. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated to generate CPS for default constructors. Created 5 years, 10 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 | « pkg/analyzer2dart/test/tree_shaker_test.dart ('k') | tests/compiler/dart2js/backend_dart/end2end_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/cps_ir/cps_ir_builder_visitor.dart
diff --git a/pkg/compiler/lib/src/cps_ir/cps_ir_builder_visitor.dart b/pkg/compiler/lib/src/cps_ir/cps_ir_builder_visitor.dart
index 9eafea621fd7bd0b0c18106d0f53e1747687240e..5f45087a4a1ab60f527eac9678c291af40c19b4c 100644
--- a/pkg/compiler/lib/src/cps_ir/cps_ir_builder_visitor.dart
+++ b/pkg/compiler/lib/src/cps_ir/cps_ir_builder_visitor.dart
@@ -67,11 +67,16 @@ class IrBuilderTask extends CompilerTask {
// TODO(sigurdm): Support native functions for dart2js.
assert(invariant(element, !element.isNative));
- // TODO(kmillikin,sigurdm): Support constructors.
- if (element is ConstructorElement && !element.isGenerativeConstructor) {
- return false;
+ if (element is ConstructorElement) {
+ if (!element.isGenerativeConstructor) {
+ // TODO(kmillikin,sigurdm): Support constructors.
+ return false;
+ }
+ if (element.isSynthesized) {
+ // Do generate CPS for synthetic constructors.
+ return true;
+ }
}
-
} else if (element is! FieldElement) {
compiler.internalError(element, "Unexpected element type $element");
}
« no previous file with comments | « pkg/analyzer2dart/test/tree_shaker_test.dart ('k') | tests/compiler/dart2js/backend_dart/end2end_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698