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

Side by Side 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: Fix test case 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library analyzer2dart.cps_generator; 5 library analyzer2dart.cps_generator;
6 6
7 import 'package:analyzer/analyzer.dart'; 7 import 'package:analyzer/analyzer.dart';
8 8
9 import 'package:compiler/src/dart_types.dart' as dart2js; 9 import 'package:compiler/src/dart_types.dart' as dart2js;
10 import 'package:compiler/src/elements/elements.dart' as dart2js; 10 import 'package:compiler/src/elements/elements.dart' as dart2js;
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 analyzer.TopLevelVariableElement element) { 43 analyzer.TopLevelVariableElement element) {
44 CpsGeneratingVisitor visitor = new CpsGeneratingVisitor(converter, element); 44 CpsGeneratingVisitor visitor = new CpsGeneratingVisitor(converter, element);
45 VariableDeclaration variableDeclaration = node; 45 VariableDeclaration variableDeclaration = node;
46 return visitor.handleFieldDeclaration(element, variableDeclaration); 46 return visitor.handleFieldDeclaration(element, variableDeclaration);
47 } 47 }
48 } 48 }
49 49
50 /// Visitor that converts analyzer AST nodes into CPS ir nodes. 50 /// Visitor that converts analyzer AST nodes into CPS ir nodes.
51 class CpsGeneratingVisitor extends SemanticVisitor<ir.Node> 51 class CpsGeneratingVisitor extends SemanticVisitor<ir.Node>
52 with IrBuilderMixin<AstNode> { 52 with IrBuilderMixin<AstNode> {
53 /// Promote the type of [irBuilder] to [DartIrBuilder].
54 /// The JS backend requires closure conversion which we do not support yet.
floitsch 2015/01/21 16:29:34 new line before? Just looking at this comment it
55 DartIrBuilder get irBuilder => super.irBuilder;
53 final analyzer.Element element; 56 final analyzer.Element element;
54 final ElementConverter converter; 57 final ElementConverter converter;
55 58
56 CpsGeneratingVisitor(this.converter, this.element); 59 CpsGeneratingVisitor(this.converter, this.element);
57 60
58 Source get currentSource => element.source; 61 Source get currentSource => element.source;
59 62
60 analyzer.LibraryElement get currentLibrary => element.library; 63 analyzer.LibraryElement get currentLibrary => element.library;
61 64
62 ir.Node visit(AstNode node) => node.accept(this); 65 ir.Node visit(AstNode node) => node.accept(this);
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after
521 return irBuilder.buildTypeOperator( 524 return irBuilder.buildTypeOperator(
522 visit(node.expression), 525 visit(node.expression),
523 converter.convertType(node.type.type), 526 converter.convertType(node.type.type),
524 isTypeTest: false); 527 isTypeTest: false);
525 } 528 }
526 } 529 }
527 530
528 class NullClosureVariableInfo extends ClosureVariableInfo { 531 class NullClosureVariableInfo extends ClosureVariableInfo {
529 Iterable get capturedVariables => const []; 532 Iterable get capturedVariables => const [];
530 } 533 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698