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

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

Issue 1036333003: Fix try catch crasher bug due to null else case. (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: ptal 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 | « no previous file | lib/src/js/nodes.dart » ('j') | no next file with comments »
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, HashMap; 7 import 'dart:collection' show HashSet, HashMap;
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 1731 matching lines...) Expand 10 before | Expand all | Expand 10 after
1742 if (node.parent is ExpressionStatement) { 1742 if (node.parent is ExpressionStatement) {
1743 return js.statement('throw #;', _visit(_catchParameter)); 1743 return js.statement('throw #;', _visit(_catchParameter));
1744 } else { 1744 } else {
1745 return js.call('dart.throw_(#)', _visit(_catchParameter)); 1745 return js.call('dart.throw_(#)', _visit(_catchParameter));
1746 } 1746 }
1747 } 1747 }
1748 1748
1749 @override 1749 @override
1750 JS.If visitIfStatement(IfStatement node) { 1750 JS.If visitIfStatement(IfStatement node) {
1751 return new JS.If(_visit(node.condition), _visit(node.thenStatement), 1751 return new JS.If(_visit(node.condition), _visit(node.thenStatement),
1752 _visitOrEmpty(node.elseStatement)); 1752 _visit(node.elseStatement));
1753 } 1753 }
1754 1754
1755 @override 1755 @override
1756 JS.For visitForStatement(ForStatement node) { 1756 JS.For visitForStatement(ForStatement node) {
1757 var init = _visit(node.initialization); 1757 var init = _visit(node.initialization);
1758 if (init == null) init = _visit(node.variables); 1758 if (init == null) init = _visit(node.variables);
1759 return new JS.For(init, _visit(node.condition), 1759 return new JS.For(init, _visit(node.condition),
1760 _visitListToBinary(node.updaters, ','), _visit(node.body)); 1760 _visitListToBinary(node.updaters, ','), _visit(node.body));
1761 } 1761 }
1762 1762
(...skipping 566 matching lines...) Expand 10 before | Expand all | Expand 10 after
2329 2329
2330 // TODO(jmesserly): in many cases marking the end will be unncessary. 2330 // TODO(jmesserly): in many cases marking the end will be unncessary.
2331 printer.mark(_location(node.end)); 2331 printer.mark(_location(node.end));
2332 } 2332 }
2333 2333
2334 String _getIdentifier(AstNode node) { 2334 String _getIdentifier(AstNode node) {
2335 if (node is SimpleIdentifier) return node.name; 2335 if (node is SimpleIdentifier) return node.name;
2336 return null; 2336 return null;
2337 } 2337 }
2338 } 2338 }
OLDNEW
« no previous file with comments | « no previous file | lib/src/js/nodes.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698