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

Side by Side Diff: pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart

Issue 1247333003: dart2js cps: Support 'on T' clauses without a 'catch'. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 5 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
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart ('k') | pkg/pkg.status » ('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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 dart2js.ir_builder_task; 5 library dart2js.ir_builder_task;
6 6
7 import '../closure.dart' as closurelib; 7 import '../closure.dart' as closurelib;
8 import '../closure.dart' hide ClosureScope; 8 import '../closure.dart' hide ClosureScope;
9 import '../constants/expressions.dart'; 9 import '../constants/expressions.dart';
10 import '../dart_types.dart'; 10 import '../dart_types.dart';
(...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after
446 JumpTarget target = elements.getTargetDefinition(node); 446 JumpTarget target = elements.getTargetDefinition(node);
447 Element error = 447 Element error =
448 (compiler.backend as JavaScriptBackend).getFallThroughError(); 448 (compiler.backend as JavaScriptBackend).getFallThroughError();
449 irBuilder.buildSimpleSwitch(target, value, cases, defaultCase, error, 449 irBuilder.buildSimpleSwitch(target, value, cases, defaultCase, error,
450 sourceInformationBuilder.buildGeneric(node)); 450 sourceInformationBuilder.buildGeneric(node));
451 } 451 }
452 452
453 visitTryStatement(ast.TryStatement node) { 453 visitTryStatement(ast.TryStatement node) {
454 List<CatchClauseInfo> catchClauseInfos = <CatchClauseInfo>[]; 454 List<CatchClauseInfo> catchClauseInfos = <CatchClauseInfo>[];
455 for (ast.CatchBlock catchClause in node.catchBlocks.nodes) { 455 for (ast.CatchBlock catchClause in node.catchBlocks.nodes) {
456 assert(catchClause.exception != null); 456 LocalVariableElement exceptionVariable;
457 LocalVariableElement exceptionVariable = elements[catchClause.exception]; 457 if (catchClause.exception != null) {
458 exceptionVariable = elements[catchClause.exception];
459 }
458 LocalVariableElement stackTraceVariable; 460 LocalVariableElement stackTraceVariable;
459 if (catchClause.trace != null) { 461 if (catchClause.trace != null) {
460 stackTraceVariable = elements[catchClause.trace]; 462 stackTraceVariable = elements[catchClause.trace];
461 } 463 }
462 DartType type; 464 DartType type;
463 if (catchClause.onKeyword != null) { 465 if (catchClause.onKeyword != null) {
464 type = elements.getType(catchClause.type); 466 type = elements.getType(catchClause.type);
465 } 467 }
466 catchClauseInfos.add(new CatchClauseInfo( 468 catchClauseInfos.add(new CatchClauseInfo(
467 type: type, 469 type: type,
(...skipping 2881 matching lines...) Expand 10 before | Expand all | Expand 10 after
3349 if (compiler.backend.isForeign(function)) { 3351 if (compiler.backend.isForeign(function)) {
3350 return handleForeignCode(node, function, argumentList, callStructure); 3352 return handleForeignCode(node, function, argumentList, callStructure);
3351 } else { 3353 } else {
3352 return irBuilder.buildStaticFunctionInvocation(function, callStructure, 3354 return irBuilder.buildStaticFunctionInvocation(function, callStructure,
3353 translateStaticArguments(argumentList, function, callStructure), 3355 translateStaticArguments(argumentList, function, callStructure),
3354 sourceInformation: 3356 sourceInformation:
3355 sourceInformationBuilder.buildCall(node, node.selector)); 3357 sourceInformationBuilder.buildCall(node, node.selector));
3356 } 3358 }
3357 } 3359 }
3358 } 3360 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart ('k') | pkg/pkg.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698