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

Side by Side Diff: lib/compiler/implementation/ssa/builder.dart

Issue 11049023: [dart2js] Report an error if throw is used outside of catch expression without an argument. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 2 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 | « lib/compiler/implementation/resolver.dart ('k') | lib/compiler/implementation/warnings.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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 class Interceptors { 5 class Interceptors {
6 Compiler compiler; 6 Compiler compiler;
7 Interceptors(Compiler this.compiler); 7 Interceptors(Compiler this.compiler);
8 8
9 SourceString mapOperatorToMethodName(Operator op) { 9 SourceString mapOperatorToMethodName(Operator op) {
10 String name = op.source.stringValue; 10 String name = op.source.stringValue;
(...skipping 3179 matching lines...) Expand 10 before | Expand all | Expand 10 after
3190 } else { 3190 } else {
3191 close(attachPosition(new HReturn(value), node)).addSuccessor(graph.exit); 3191 close(attachPosition(new HReturn(value), node)).addSuccessor(graph.exit);
3192 } 3192 }
3193 } 3193 }
3194 3194
3195 visitThrow(Throw node) { 3195 visitThrow(Throw node) {
3196 if (node.expression === null) { 3196 if (node.expression === null) {
3197 HInstruction exception = rethrowableException; 3197 HInstruction exception = rethrowableException;
3198 if (exception === null) { 3198 if (exception === null) {
3199 exception = graph.addConstantNull(constantSystem); 3199 exception = graph.addConstantNull(constantSystem);
3200 compiler.reportError(node, 3200 compiler.internalError('rethrowableException should not be null', node);
ahe 2012/10/03 10:25:28 I think you should use "node: node". I plan to mak
Roman 2012/10/03 10:36:20 Done.
3201 'throw without expression outside catch block');
3202 } 3201 }
3203 close(new HThrow(exception, isRethrow: true)); 3202 close(new HThrow(exception, isRethrow: true));
3204 } else { 3203 } else {
3205 visit(node.expression); 3204 visit(node.expression);
3206 close(new HThrow(pop())); 3205 close(new HThrow(pop()));
3207 } 3206 }
3208 } 3207 }
3209 3208
3210 visitTypeAnnotation(TypeAnnotation node) { 3209 visitTypeAnnotation(TypeAnnotation node) {
3211 compiler.internalError('visiting type annotation in SSA builder', 3210 compiler.internalError('visiting type annotation in SSA builder',
(...skipping 1177 matching lines...) Expand 10 before | Expand all | Expand 10 after
4389 new HSubGraphBlockInformation(elseBranch.graph)); 4388 new HSubGraphBlockInformation(elseBranch.graph));
4390 4389
4391 HBasicBlock conditionStartBlock = conditionBranch.block; 4390 HBasicBlock conditionStartBlock = conditionBranch.block;
4392 conditionStartBlock.setBlockFlow(info, joinBlock); 4391 conditionStartBlock.setBlockFlow(info, joinBlock);
4393 SubGraph conditionGraph = conditionBranch.graph; 4392 SubGraph conditionGraph = conditionBranch.graph;
4394 HIf branch = conditionGraph.end.last; 4393 HIf branch = conditionGraph.end.last;
4395 assert(branch is HIf); 4394 assert(branch is HIf);
4396 branch.blockInformation = conditionStartBlock.blockFlow; 4395 branch.blockInformation = conditionStartBlock.blockFlow;
4397 } 4396 }
4398 } 4397 }
OLDNEW
« no previous file with comments | « lib/compiler/implementation/resolver.dart ('k') | lib/compiler/implementation/warnings.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698