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 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 Loading... |
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 Loading... |
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 } |
OLD | NEW |