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

Unified Diff: pkg/analyzer2dart/lib/src/cps_generator.dart

Issue 900403003: Support default constructors in analyzer2dart. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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
Index: pkg/analyzer2dart/lib/src/cps_generator.dart
diff --git a/pkg/analyzer2dart/lib/src/cps_generator.dart b/pkg/analyzer2dart/lib/src/cps_generator.dart
index 7a4499ac9434b2753abecc7fc76a2d4b8fe2fb8c..0d73e9169ab9bca97f31d30d26930122fa11f83c 100644
--- a/pkg/analyzer2dart/lib/src/cps_generator.dart
+++ b/pkg/analyzer2dart/lib/src/cps_generator.dart
@@ -56,16 +56,15 @@ class CpsElementVisitor extends analyzer.SimpleElementVisitor<ir.Node> {
@override
ir.ExecutableDefinition visitConstructorElement(
analyzer.ConstructorElement element) {
+ if (element.isSynthetic) {
+ // Don't generate CPS for synthetic (default) constructors.
sigurdm 2015/02/10 09:37:56 For the js-case it makes sense to represent these
Johnni Winther 2015/02/10 13:51:57 Reverted.
+ return null;
+ }
CpsGeneratingVisitor visitor = new CpsGeneratingVisitor(converter, element);
if (!element.isFactory) {
ConstructorDeclaration constructorDeclaration = node;
- FunctionBody body;
- if (constructorDeclaration != null) {
- body = constructorDeclaration.body;
- } else {
- assert(element.isSynthetic);
- }
- return visitor.handleConstructorDeclaration(element, body);
+ return visitor.handleConstructorDeclaration(element,
+ constructorDeclaration.body);
}
// TODO(johnniwinther): Support factory constructors.
return null;

Powered by Google App Engine
This is Rietveld 408576698