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

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: Removed obsolete TODO 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 DartIrBuilder get irBuilder => super.irBuilder;
floitsch 2015/01/20 17:26:26 Explain why.
53 final analyzer.Element element; 54 final analyzer.Element element;
54 final ElementConverter converter; 55 final ElementConverter converter;
55 56
56 CpsGeneratingVisitor(this.converter, this.element); 57 CpsGeneratingVisitor(this.converter, this.element);
57 58
58 Source get currentSource => element.source; 59 Source get currentSource => element.source;
59 60
60 analyzer.LibraryElement get currentLibrary => element.library; 61 analyzer.LibraryElement get currentLibrary => element.library;
61 62
62 ir.Node visit(AstNode node) => node.accept(this); 63 ir.Node visit(AstNode node) => node.accept(this);
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after
521 return irBuilder.buildTypeOperator( 522 return irBuilder.buildTypeOperator(
522 visit(node.expression), 523 visit(node.expression),
523 converter.convertType(node.type.type), 524 converter.convertType(node.type.type),
524 isTypeTest: false); 525 isTypeTest: false);
525 } 526 }
526 } 527 }
527 528
528 class NullClosureVariableInfo extends ClosureVariableInfo { 529 class NullClosureVariableInfo extends ClosureVariableInfo {
529 Iterable get capturedVariables => const []; 530 Iterable get capturedVariables => const [];
530 } 531 }
OLDNEW
« no previous file with comments | « no previous file | pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart » ('j') | pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698