| OLD | NEW |
| 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 library dart2js.resolution.members; | 5 library dart2js.resolution.members; |
| 6 | 6 |
| 7 import '../common.dart'; | 7 import '../common.dart'; |
| 8 import '../common/names.dart' show | 8 import '../common/names.dart' show |
| 9 Selectors; | 9 Selectors; |
| 10 import '../common/resolution.dart' show | 10 import '../common/resolution.dart' show |
| (...skipping 3640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3651 } | 3651 } |
| 3652 | 3652 |
| 3653 ResolutionResult visitNodeList(NodeList node) { | 3653 ResolutionResult visitNodeList(NodeList node) { |
| 3654 for (Link<Node> link = node.nodes; !link.isEmpty; link = link.tail) { | 3654 for (Link<Node> link = node.nodes; !link.isEmpty; link = link.tail) { |
| 3655 visit(link.head); | 3655 visit(link.head); |
| 3656 } | 3656 } |
| 3657 return const NoneResult(); | 3657 return const NoneResult(); |
| 3658 } | 3658 } |
| 3659 | 3659 |
| 3660 ResolutionResult visitRethrow(Rethrow node) { | 3660 ResolutionResult visitRethrow(Rethrow node) { |
| 3661 if (!inCatchBlock) { | 3661 if (!inCatchBlock && node.throwToken.stringValue == 'rethrow') { |
| 3662 reporter.reportErrorMessage( | 3662 reporter.reportErrorMessage( |
| 3663 node, MessageKind.THROW_WITHOUT_EXPRESSION); | 3663 node, MessageKind.RETHROW_OUTSIDE_CATCH); |
| 3664 } | 3664 } |
| 3665 return const NoneResult(); | 3665 return const NoneResult(); |
| 3666 } | 3666 } |
| 3667 | 3667 |
| 3668 ResolutionResult visitReturn(Return node) { | 3668 ResolutionResult visitReturn(Return node) { |
| 3669 Node expression = node.expression; | 3669 Node expression = node.expression; |
| 3670 if (expression != null) { | 3670 if (expression != null) { |
| 3671 if (enclosingElement.isGenerativeConstructor) { | 3671 if (enclosingElement.isGenerativeConstructor) { |
| 3672 // It is a compile-time error if a return statement of the form | 3672 // It is a compile-time error if a return statement of the form |
| 3673 // `return e;` appears in a generative constructor. (Dart Language | 3673 // `return e;` appears in a generative constructor. (Dart Language |
| (...skipping 1190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4864 } | 4864 } |
| 4865 return const NoneResult(); | 4865 return const NoneResult(); |
| 4866 } | 4866 } |
| 4867 } | 4867 } |
| 4868 | 4868 |
| 4869 /// Looks up [name] in [scope] and unwraps the result. | 4869 /// Looks up [name] in [scope] and unwraps the result. |
| 4870 Element lookupInScope(DiagnosticReporter reporter, Node node, | 4870 Element lookupInScope(DiagnosticReporter reporter, Node node, |
| 4871 Scope scope, String name) { | 4871 Scope scope, String name) { |
| 4872 return Elements.unwrap(scope.lookup(name), reporter, node); | 4872 return Elements.unwrap(scope.lookup(name), reporter, node); |
| 4873 } | 4873 } |
| OLD | NEW |