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

Side by Side Diff: pkg/compiler/lib/src/js_backend/namer_names.dart

Issue 2898403002: Use failedAt in more places (Closed)
Patch Set: merge; address comments Created 3 years, 7 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 part of js_backend.namer; 5 part of js_backend.namer;
6 6
7 abstract class _NamerName extends jsAst.Name { 7 abstract class _NamerName extends jsAst.Name {
8 int get _kind; 8 int get _kind;
9 _NamerName get _target => this; 9 _NamerName get _target => this;
10 10
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 bool operator ==(other) { 184 bool operator ==(other) {
185 if (other is _NameReference) other = other._target; 185 if (other is _NameReference) other = other._target;
186 if (identical(this, other)) return true; 186 if (identical(this, other)) return true;
187 return false; 187 return false;
188 } 188 }
189 189
190 @override 190 @override
191 int get hashCode => super.hashCode; 191 int get hashCode => super.hashCode;
192 192
193 finalize() { 193 finalize() {
194 assert(invariant(NO_LOCATION_SPANNABLE, !isFinalized, 194 assert(
195 message: "TokenName($key)=$_name has already been finalized.")); 195 !isFinalized,
196 failedAt(NO_LOCATION_SPANNABLE,
197 "TokenName($key)=$_name has already been finalized."));
196 _name = _scope.getNextName(); 198 _name = _scope.getNextName();
197 } 199 }
198 } 200 }
199 201
200 class _NameReference extends _NamerName implements jsAst.AstContainer { 202 class _NameReference extends _NamerName implements jsAst.AstContainer {
201 _NamerName _target; 203 _NamerName _target;
202 204
203 int get _kind => _target._kind; 205 int get _kind => _target._kind;
204 String get key => _target.key; 206 String get key => _target.key;
205 207
206 Iterable<jsAst.Node> get containedNodes => [_target]; 208 Iterable<jsAst.Node> get containedNodes => [_target];
207 209
208 _NameReference(this._target); 210 _NameReference(this._target);
209 211
210 String get name => _target.name; 212 String get name => _target.name;
211 213
212 @override 214 @override
213 int compareTo(_NamerName other) => _target.compareTo(other); 215 int compareTo(_NamerName other) => _target.compareTo(other);
214 216
215 @override 217 @override
216 bool operator ==(other) => _target == other; 218 bool operator ==(other) => _target == other;
217 219
218 @override 220 @override
219 int get hashCode => _target.hashCode; 221 int get hashCode => _target.hashCode;
220 } 222 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/js_backend/namer.dart ('k') | pkg/compiler/lib/src/js_backend/native_data.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698