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

Side by Side Diff: lib/src/codegen/js_codegen.dart

Issue 998043002: Fixes in codegen and test script (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 9 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
« no previous file with comments | « .gitignore ('k') | lib/src/js/js_ast.dart » ('j') | test/test.sh » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 var decl = new JS.VariableDeclaration(name.name);
1541 decl.sourceInformation = name;
1542 body.add(js.statement('let # = #;', [decl, _catchParameter]));
1541 _catchParameter = name.name; 1543 _catchParameter = name.name;
1542 } 1544 }
1543 if (node.stackTraceParameter != null) { 1545 if (node.stackTraceParameter != null) {
1544 var stackVar = node.stackTraceParameter.name; 1546 var stackVar = node.stackTraceParameter.name;
1545 body.add(js.statement( 1547 body.add(js.statement(
1546 'let # = dart.stackTrace(#);', [stackVar, _visit(name)])); 1548 'let # = dart.stackTrace(#);', [stackVar, _visit(name)]));
1547 } 1549 }
1548 } 1550 }
1549 1551
1550 body.add(_visit(node.body)); 1552 body.add(_visit(node.body));
(...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after
2037 2039
2038 // TODO(jmesserly): in many cases marking the end will be unncessary. 2040 // TODO(jmesserly): in many cases marking the end will be unncessary.
2039 printer.mark(_location(node.end)); 2041 printer.mark(_location(node.end));
2040 } 2042 }
2041 2043
2042 String _getIdentifier(AstNode node) { 2044 String _getIdentifier(AstNode node) {
2043 if (node is SimpleIdentifier) return node.name; 2045 if (node is SimpleIdentifier) return node.name;
2044 return null; 2046 return null;
2045 } 2047 }
2046 } 2048 }
OLDNEW
« no previous file with comments | « .gitignore ('k') | lib/src/js/js_ast.dart » ('j') | test/test.sh » ('J')

Powered by Google App Engine
This is Rietveld 408576698