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

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

Issue 862703002: Implement constructor bodies and initializers in CPS->JS backend. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebase again Created 5 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
« no previous file with comments | « no previous file | pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 d9eba2504571fbd526e551d3b7a1b8e0c3a2db00..03cc77a337d7eee4065719783d1ec99e1ac2e103 100644
--- a/pkg/analyzer2dart/lib/src/cps_generator.dart
+++ b/pkg/analyzer2dart/lib/src/cps_generator.dart
@@ -50,6 +50,9 @@ class CpsElementVisitor extends analyzer.SimpleElementVisitor<ir.Node> {
/// Visitor that converts analyzer AST nodes into CPS ir nodes.
class CpsGeneratingVisitor extends SemanticVisitor<ir.Node>
with IrBuilderMixin<AstNode> {
+ /// Promote the type of [irBuilder] to [DartIrBuilder].
+ /// The JS backend requires closure conversion which we do not support yet.
+ DartIrBuilder get irBuilder => super.irBuilder;
final analyzer.Element element;
final ElementConverter converter;
@@ -68,7 +71,7 @@ class CpsGeneratingVisitor extends SemanticVisitor<ir.Node>
new DartIrBuilder(DART_CONSTANT_SYSTEM,
element,
// TODO(johnniwinther): Supported closure variables.
- new NullClosureVariableInfo()),
+ new NullCapturedVariableInfo()),
() {
irBuilder.buildFieldInitializerHeader();
ir.Primitive initializer = build(node.initializer);
@@ -83,7 +86,7 @@ class CpsGeneratingVisitor extends SemanticVisitor<ir.Node>
new DartIrBuilder(DART_CONSTANT_SYSTEM,
element,
// TODO(johnniwinther): Supported closure variables.
- new NullClosureVariableInfo()),
+ new NullCapturedVariableInfo()),
() {
irBuilder.buildFunctionHeader(
function.parameters.map(converter.convertElement));
@@ -525,6 +528,6 @@ class CpsGeneratingVisitor extends SemanticVisitor<ir.Node>
}
}
-class NullClosureVariableInfo extends ClosureVariableInfo {
+class NullCapturedVariableInfo extends DartCapturedVariableInfo {
Iterable get capturedVariables => const [];
}
« no previous file with comments | « no previous file | pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698