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

Side by Side Diff: pkg/compiler/lib/src/js/js.dart

Issue 2969873002: Add NodeVisitor1 to js_ast (Closed)
Patch Set: Updated cf. comment Created 3 years, 5 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 | pkg/compiler/lib/src/js/rewrite_async.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 js; 5 library js;
6 6
7 import 'package:js_ast/js_ast.dart'; 7 import 'package:js_ast/js_ast.dart';
8 8
9 import '../common.dart'; 9 import '../common.dart';
10 import '../options.dart'; 10 import '../options.dart';
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 for (Node element in node.containedNodes) { 109 for (Node element in node.containedNodes) {
110 element.accept(this); 110 element.accept(this);
111 } 111 }
112 } else if (node is ReferenceCountedAstNode) { 112 } else if (node is ReferenceCountedAstNode) {
113 node.markSeen(this); 113 node.markSeen(this);
114 } else { 114 } else {
115 super.visitNode(node); 115 super.visitNode(node);
116 } 116 }
117 } 117 }
118 118
119 void countTokens(Node node) => node.accept(this); 119 // TODO(28763): Remove `<dynamic>` when issue 28763 is fixed.
120 void countTokens(Node node) => node.accept<dynamic>(this);
120 } 121 }
121 122
122 abstract class ReferenceCountedAstNode implements Node { 123 abstract class ReferenceCountedAstNode implements Node {
123 markSeen(TokenCounter visitor); 124 markSeen(TokenCounter visitor);
124 } 125 }
125 126
126 /// Represents the LiteralString resulting from unparsing [expression]. The 127 /// Represents the LiteralString resulting from unparsing [expression]. The
127 /// actual unparsing is done on demand when requesting the [value] of this 128 /// actual unparsing is done on demand when requesting the [value] of this
128 /// node. 129 /// node.
129 /// 130 ///
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 } 188 }
188 if (node is PropertyAccess) { 189 if (node is PropertyAccess) {
189 PropertyAccess access = node; 190 PropertyAccess access = node;
190 if (access.receiver is InterpolatedExpression) { 191 if (access.receiver is InterpolatedExpression) {
191 InterpolatedExpression hole = access.receiver; 192 InterpolatedExpression hole = access.receiver;
192 return hole.isPositional && hole.nameOrPosition == 0; 193 return hole.isPositional && hole.nameOrPosition == 0;
193 } 194 }
194 } 195 }
195 return false; 196 return false;
196 } 197 }
OLDNEW
« no previous file with comments | « no previous file | pkg/compiler/lib/src/js/rewrite_async.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698