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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/resolution/members.dart

Issue 13947004: dart2js: Allow 'throw' when inlining (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Nicolas' Code review feedback Created 7 years, 8 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) 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 part of resolution; 5 part of resolution;
6 6
7 abstract class TreeElements { 7 abstract class TreeElements {
8 Element get currentElement; 8 Element get currentElement;
9 Set<Node> get superUses; 9 Set<Node> get superUses;
10 10
(...skipping 2459 matching lines...) Expand 10 before | Expand all | Expand 10 after
2470 } 2470 }
2471 world.registerStaticUse(redirectionTarget); 2471 world.registerStaticUse(redirectionTarget);
2472 world.registerInstantiatedClass( 2472 world.registerInstantiatedClass(
2473 redirectionTarget.enclosingElement.declaration, mapping); 2473 redirectionTarget.enclosingElement.declaration, mapping);
2474 } 2474 }
2475 2475
2476 visitThrow(Throw node) { 2476 visitThrow(Throw node) {
2477 if (!inCatchBlock && node.expression == null) { 2477 if (!inCatchBlock && node.expression == null) {
2478 error(node, MessageKind.THROW_WITHOUT_EXPRESSION); 2478 error(node, MessageKind.THROW_WITHOUT_EXPRESSION);
2479 } 2479 }
2480 compiler.backend.registerThrow(mapping); 2480 // We don't know ahead of time whether we will need the throw in a statement
2481 // context or an expression context, so we register both here, even though
2482 // we may not need ThrowExpression.
2483 compiler.backend.registerWrapException(mapping);
2484 compiler.backend.registerThrowExpression(mapping);
2481 visit(node.expression); 2485 visit(node.expression);
2482 } 2486 }
2483 2487
2484 visitVariableDefinitions(VariableDefinitions node) { 2488 visitVariableDefinitions(VariableDefinitions node) {
2485 VariableDefinitionsVisitor visitor = 2489 VariableDefinitionsVisitor visitor =
2486 new VariableDefinitionsVisitor(compiler, node, this, 2490 new VariableDefinitionsVisitor(compiler, node, this,
2487 ElementKind.VARIABLE); 2491 ElementKind.VARIABLE);
2488 // Ensure that we set the type of the [VariableListElement] since it depends 2492 // Ensure that we set the type of the [VariableListElement] since it depends
2489 // on the current scope. If the current scope is a [MethodScope] or 2493 // on the current scope. If the current scope is a [MethodScope] or
2490 // [BlockScope] it will not be available for the 2494 // [BlockScope] it will not be available for the
(...skipping 1383 matching lines...) Expand 10 before | Expand all | Expand 10 after
3874 return e; 3878 return e;
3875 } 3879 }
3876 3880
3877 /// Assumed to be called by [resolveRedirectingFactory]. 3881 /// Assumed to be called by [resolveRedirectingFactory].
3878 Element visitReturn(Return node) { 3882 Element visitReturn(Return node) {
3879 Node expression = node.expression; 3883 Node expression = node.expression;
3880 return finishConstructorReference(visit(expression), 3884 return finishConstructorReference(visit(expression),
3881 expression, expression); 3885 expression, expression);
3882 } 3886 }
3883 } 3887 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698