Chromium Code Reviews| 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/names.dart' show | 7 import '../common/names.dart' show |
| 8 Selectors; | 8 Selectors; |
| 9 import '../compiler.dart' show | 9 import '../compiler.dart' show |
| 10 Compiler; | 10 Compiler; |
| (...skipping 4545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4556 visitIn(node.statements, new BlockScope(scope)); | 4556 visitIn(node.statements, new BlockScope(scope)); |
| 4557 return const NoneResult(); | 4557 return const NoneResult(); |
| 4558 } | 4558 } |
| 4559 | 4559 |
| 4560 ResolutionResult visitCaseMatch(CaseMatch node) { | 4560 ResolutionResult visitCaseMatch(CaseMatch node) { |
| 4561 visit(node.expression); | 4561 visit(node.expression); |
| 4562 return const NoneResult(); | 4562 return const NoneResult(); |
| 4563 } | 4563 } |
| 4564 | 4564 |
| 4565 ResolutionResult visitTryStatement(TryStatement node) { | 4565 ResolutionResult visitTryStatement(TryStatement node) { |
| 4566 // TODO(karlklose): also track the information about mutated variables, catc h, and | |
|
Kevin Millikin (Google)
2015/09/07 09:11:17
I guess that's a long line.
| |
| 4567 // finally-block. | |
| 4568 elements.hasTryStatement = true; | |
| 4569 | |
| 4566 visit(node.tryBlock); | 4570 visit(node.tryBlock); |
| 4567 if (node.catchBlocks.isEmpty && node.finallyBlock == null) { | 4571 if (node.catchBlocks.isEmpty && node.finallyBlock == null) { |
| 4568 error(node.getEndToken().next, MessageKind.NO_CATCH_NOR_FINALLY); | 4572 error(node.getEndToken().next, MessageKind.NO_CATCH_NOR_FINALLY); |
| 4569 } | 4573 } |
| 4570 visit(node.catchBlocks); | 4574 visit(node.catchBlocks); |
| 4571 visit(node.finallyBlock); | 4575 visit(node.finallyBlock); |
| 4572 return const NoneResult(); | 4576 return const NoneResult(); |
| 4573 } | 4577 } |
| 4574 | 4578 |
| 4575 ResolutionResult visitCatchBlock(CatchBlock node) { | 4579 ResolutionResult visitCatchBlock(CatchBlock node) { |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4644 } | 4648 } |
| 4645 return const NoneResult(); | 4649 return const NoneResult(); |
| 4646 } | 4650 } |
| 4647 } | 4651 } |
| 4648 | 4652 |
| 4649 /// Looks up [name] in [scope] and unwraps the result. | 4653 /// Looks up [name] in [scope] and unwraps the result. |
| 4650 Element lookupInScope(Compiler compiler, Node node, | 4654 Element lookupInScope(Compiler compiler, Node node, |
| 4651 Scope scope, String name) { | 4655 Scope scope, String name) { |
| 4652 return Elements.unwrap(scope.lookup(name), compiler, node); | 4656 return Elements.unwrap(scope.lookup(name), compiler, node); |
| 4653 } | 4657 } |
| OLD | NEW |