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

Side by Side Diff: pkg/analyzer2dart/lib/src/cps_generator.dart

Issue 979813002: Support simple try in analyzer2dart. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments. Created 5 years, 9 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
« no previous file with comments | « no previous file | pkg/analyzer2dart/test/end2end_data.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 554 matching lines...) Expand 10 before | Expand all | Expand 10 after
565 isNotCheck: node.notOperator != null); 565 isNotCheck: node.notOperator != null);
566 } 566 }
567 567
568 @override 568 @override
569 ir.Primitive visitAsExpression(AsExpression node) { 569 ir.Primitive visitAsExpression(AsExpression node) {
570 return irBuilder.buildTypeOperator( 570 return irBuilder.buildTypeOperator(
571 visit(node.expression), 571 visit(node.expression),
572 converter.convertType(node.type.type), 572 converter.convertType(node.type.type),
573 isTypeTest: false); 573 isTypeTest: false);
574 } 574 }
575
576 @override
577 visitTryStatement(TryStatement node) {
578 List<CatchClauseInfo> catchClauseInfos = <CatchClauseInfo>[];
579 for (CatchClause catchClause in node.catchClauses) {
580 catchClauseInfos.add(new CatchClauseInfo(
581 exceptionVariable: converter.convertElement(
582 catchClause.exceptionParameter.staticElement),
583 buildCatchBlock: subbuild(catchClause.body)));
584
585 }
586 irBuilder.buildTry(
587 tryStatementInfo: new TryStatementInfo(),
588 buildTryBlock: subbuild(node.body),
589 catchClauseInfos: catchClauseInfos);
590 }
575 } 591 }
576 592
577 class NullCapturedVariables extends DartCapturedVariables { 593 class NullCapturedVariables extends DartCapturedVariables {
578 NullCapturedVariables() : super(null); 594 NullCapturedVariables() : super(null);
579 } 595 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer2dart/test/end2end_data.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698