Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 dev_compiler.src.codegen.js_codegen; | 5 library dev_compiler.src.codegen.js_codegen; |
| 6 | 6 |
| 7 import 'dart:collection' show HashSet; | 7 import 'dart:collection' show HashSet; |
| 8 import 'dart:io' show Directory, File; | 8 import 'dart:io' show Directory, File; |
| 9 | 9 |
| 10 import 'package:analyzer/analyzer.dart' hide ConstantEvaluator; | 10 import 'package:analyzer/analyzer.dart' hide ConstantEvaluator; |
| (...skipping 1519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1530 } | 1530 } |
| 1531 | 1531 |
| 1532 @override | 1532 @override |
| 1533 JS.Statement visitCatchClause(CatchClause node) { | 1533 JS.Statement visitCatchClause(CatchClause node) { |
| 1534 var body = []; | 1534 var body = []; |
| 1535 | 1535 |
| 1536 var savedCatch = _catchParameter; | 1536 var savedCatch = _catchParameter; |
| 1537 if (node.catchKeyword != null) { | 1537 if (node.catchKeyword != null) { |
| 1538 var name = node.exceptionParameter; | 1538 var name = node.exceptionParameter; |
| 1539 if (name != null && name.name != _catchParameter) { | 1539 if (name != null && name.name != _catchParameter) { |
| 1540 body.add(js.statement('let # = #;', [_visit(name), _catchParameter])); | 1540 body.add(js.statement('let # = #;', [name.name, _catchParameter])); |
|
Jennifer Messerly
2015/03/11 20:28:54
hmmm. This is not going to have source location as
Siggi Cherem (dart-lang)
2015/03/11 23:27:22
Oh, I see.
Jennifer Messerly
2015/03/11 23:48:00
ouch, yeah, it seems like my Template.visitInterpo
| |
| 1541 _catchParameter = name.name; | 1541 _catchParameter = name.name; |
| 1542 } | 1542 } |
| 1543 if (node.stackTraceParameter != null) { | 1543 if (node.stackTraceParameter != null) { |
| 1544 var stackVar = node.stackTraceParameter.name; | 1544 var stackVar = node.stackTraceParameter.name; |
| 1545 body.add(js.statement( | 1545 body.add(js.statement( |
| 1546 'let # = dart.stackTrace(#);', [stackVar, _visit(name)])); | 1546 'let # = dart.stackTrace(#);', [stackVar, _visit(name)])); |
| 1547 } | 1547 } |
| 1548 } | 1548 } |
| 1549 | 1549 |
| 1550 body.add(_visit(node.body)); | 1550 body.add(_visit(node.body)); |
| (...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2037 | 2037 |
| 2038 // TODO(jmesserly): in many cases marking the end will be unncessary. | 2038 // TODO(jmesserly): in many cases marking the end will be unncessary. |
| 2039 printer.mark(_location(node.end)); | 2039 printer.mark(_location(node.end)); |
| 2040 } | 2040 } |
| 2041 | 2041 |
| 2042 String _getIdentifier(AstNode node) { | 2042 String _getIdentifier(AstNode node) { |
| 2043 if (node is SimpleIdentifier) return node.name; | 2043 if (node is SimpleIdentifier) return node.name; |
| 2044 return null; | 2044 return null; |
| 2045 } | 2045 } |
| 2046 } | 2046 } |
| OLD | NEW |