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

Side by Side Diff: pkg/dev_compiler/lib/src/js_ast/template.dart

Issue 2797873002: Preserve async markers when parsing js_ast (Closed)
Patch Set: Add comments to test Created 3 years, 8 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 | tests/language_strong/async_cascade_test.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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 part of js_ast; 5 part of js_ast;
6 6
7 class TemplateManager { 7 class TemplateManager {
8 Map<String, Template> expressionTemplates = new Map<String, Template>(); 8 Map<String, Template> expressionTemplates = new Map<String, Template>();
9 Map<String, Template> statementTemplates = new Map<String, Template>(); 9 Map<String, Template> statementTemplates = new Map<String, Template>();
10 10
(...skipping 652 matching lines...) Expand 10 before | Expand all | Expand 10 after
663 if (result is Iterable) { 663 if (result is Iterable) {
664 for (var r in result) params.add(r); 664 for (var r in result) params.add(r);
665 } else { 665 } else {
666 params.add(result); 666 params.add(result);
667 } 667 }
668 } 668 }
669 var body = makeBody(arguments); 669 var body = makeBody(arguments);
670 if (node is ArrowFun) { 670 if (node is ArrowFun) {
671 return new ArrowFun(params, body); 671 return new ArrowFun(params, body);
672 } else if (node is Fun) { 672 } else if (node is Fun) {
673 return new Fun(params, body); 673 return new Fun(params, body,
674 isGenerator: node.isGenerator, asyncModifier: node.asyncModifier);
674 } else { 675 } else {
675 throw "Unknown FunctionExpression type ${node.runtimeType}: $node"; 676 throw "Unknown FunctionExpression type ${node.runtimeType}: $node";
676 } 677 }
677 }; 678 };
678 } 679 }
679 680
680 Instantiator visitFun(Fun node) => visitFunctionExpression(node); 681 Instantiator visitFun(Fun node) => visitFunctionExpression(node);
681 682
682 Instantiator visitArrowFun(ArrowFun node) => visitFunctionExpression(node); 683 Instantiator visitArrowFun(ArrowFun node) => visitFunctionExpression(node);
683 684
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
912 if (count != before) containsInterpolatedNode.add(node); 913 if (count != before) containsInterpolatedNode.add(node);
913 return null; 914 return null;
914 } 915 }
915 916
916 visitInterpolatedNode(InterpolatedNode node) { 917 visitInterpolatedNode(InterpolatedNode node) {
917 containsInterpolatedNode.add(node); 918 containsInterpolatedNode.add(node);
918 if (node.isNamed) holeNames.add(node.nameOrPosition); 919 if (node.isNamed) holeNames.add(node.nameOrPosition);
919 ++count; 920 ++count;
920 } 921 }
921 } 922 }
OLDNEW
« no previous file with comments | « no previous file | tests/language_strong/async_cascade_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698