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

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

Issue 2647043002: Fix hints reported by analyzer. (Closed)
Patch Set: Address review comments. Created 3 years, 11 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
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 '../compiler.dart' show Compiler; 10 import '../compiler.dart' show Compiler;
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 markSeen(TokenCounter visitor); 122 markSeen(TokenCounter visitor);
123 } 123 }
124 124
125 /// Represents the LiteralString resulting from unparsing [expression]. The 125 /// Represents the LiteralString resulting from unparsing [expression]. The
126 /// actual unparsing is done on demand when requesting the [value] of this 126 /// actual unparsing is done on demand when requesting the [value] of this
127 /// node. 127 /// node.
128 /// 128 ///
129 /// This is used when generated code needs to be represented as a string, 129 /// This is used when generated code needs to be represented as a string,
130 /// for example by the lazy emitter or when generating code generators. 130 /// for example by the lazy emitter or when generating code generators.
131 class UnparsedNode extends DeferredString implements AstContainer { 131 class UnparsedNode extends DeferredString implements AstContainer {
132 @override
133 final Node tree; 132 final Node tree;
134 final Compiler _compiler; 133 final Compiler _compiler;
135 final bool _protectForEval; 134 final bool _protectForEval;
136 LiteralString _cachedLiteral; 135 LiteralString _cachedLiteral;
137 136
138 Iterable<Node> get containedNodes => [tree]; 137 Iterable<Node> get containedNodes => [tree];
139 138
140 /// A [js.Literal] that represents the string result of unparsing [ast]. 139 /// A [js.Literal] that represents the string result of unparsing [ast].
141 /// 140 ///
142 /// When its string [value] is requested, the node pretty-prints the given 141 /// When its string [value] is requested, the node pretty-prints the given
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 } 186 }
188 if (node is PropertyAccess) { 187 if (node is PropertyAccess) {
189 PropertyAccess access = node; 188 PropertyAccess access = node;
190 if (access.receiver is InterpolatedExpression) { 189 if (access.receiver is InterpolatedExpression) {
191 InterpolatedExpression hole = access.receiver; 190 InterpolatedExpression hole = access.receiver;
192 return hole.isPositional && hole.nameOrPosition == 0; 191 return hole.isPositional && hole.nameOrPosition == 0;
193 } 192 }
194 } 193 }
195 return false; 194 return false;
196 } 195 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/inferrer/type_graph_inferrer.dart ('k') | pkg/compiler/lib/src/js_backend/backend.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698