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

Side by Side Diff: pkg/compiler/lib/src/serialization/modelz.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 /// Implementation of the element model used for deserialiation. 5 /// Implementation of the element model used for deserialiation.
6 /// 6 ///
7 /// These classes are created by [ElementDeserializer] triggered by the 7 /// These classes are created by [ElementDeserializer] triggered by the
8 /// [Deserializer]. 8 /// [Deserializer].
9 9
10 library dart2js.serialization.modelz; 10 library dart2js.serialization.modelz;
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 bool get hasNode => false; 285 bool get hasNode => false;
286 286
287 @override 287 @override
288 bool get hasResolvedAst => _resolvedAst != null; 288 bool get hasResolvedAst => _resolvedAst != null;
289 289
290 @override 290 @override
291 get node => _unsupported('node'); 291 get node => _unsupported('node');
292 292
293 @override 293 @override
294 ResolvedAst get resolvedAst { 294 ResolvedAst get resolvedAst {
295 assert(invariant(this, _resolvedAst != null, 295 assert(_resolvedAst != null,
296 message: "ResolvedAst has not been set for $this.")); 296 failedAt(this, "ResolvedAst has not been set for $this."));
297 return _resolvedAst; 297 return _resolvedAst;
298 } 298 }
299 299
300 void set resolvedAst(ResolvedAst value) { 300 void set resolvedAst(ResolvedAst value) {
301 assert(invariant(this, _resolvedAst == null, 301 assert(_resolvedAst == null,
302 message: "ResolvedAst has already been set for $this.")); 302 failedAt(this, "ResolvedAst has already been set for $this."));
303 _resolvedAst = value; 303 _resolvedAst = value;
304 } 304 }
305 } 305 }
306 306
307 abstract class ContainerMixin 307 abstract class ContainerMixin
308 implements DeserializedElementZ, ScopeContainerElement { 308 implements DeserializedElementZ, ScopeContainerElement {
309 MappedContainer _membersMap = new MappedContainer(); 309 MappedContainer _membersMap = new MappedContainer();
310 310
311 @override 311 @override
312 Element localLookup(String name) { 312 Element localLookup(String name) {
(...skipping 1715 matching lines...) Expand 10 before | Expand all | Expand 10 after
2028 return visitor.visitTypeVariableElement(this, arg); 2028 return visitor.visitTypeVariableElement(this, arg);
2029 } 2029 }
2030 2030
2031 @override 2031 @override
2032 CompilationUnitElement get compilationUnit { 2032 CompilationUnitElement get compilationUnit {
2033 return typeDeclaration.compilationUnit; 2033 return typeDeclaration.compilationUnit;
2034 } 2034 }
2035 2035
2036 @override 2036 @override
2037 ResolutionTypeVariableType get type { 2037 ResolutionTypeVariableType get type {
2038 assert(invariant(this, _type != null, 2038 assert(_type != null,
2039 message: "Type variable type has not been set on $this.")); 2039 failedAt(this, "Type variable type has not been set on $this."));
2040 return _type; 2040 return _type;
2041 } 2041 }
2042 2042
2043 @override 2043 @override
2044 ResolutionTypeVariableType computeType(Resolution resolution) => type; 2044 ResolutionTypeVariableType computeType(Resolution resolution) => type;
2045 2045
2046 @override 2046 @override
2047 Element get enclosingElement => typeDeclaration; 2047 Element get enclosingElement => typeDeclaration;
2048 2048
2049 @override 2049 @override
2050 Element get enclosingClass => typeDeclaration; 2050 Element get enclosingClass => typeDeclaration;
2051 2051
2052 ResolutionDartType get bound { 2052 ResolutionDartType get bound {
2053 assert(invariant(this, _bound != null, 2053 assert(_bound != null,
2054 message: "Type variable bound has not been set on $this.")); 2054 failedAt(this, "Type variable bound has not been set on $this."));
2055 return _bound; 2055 return _bound;
2056 } 2056 }
2057 2057
2058 @override 2058 @override
2059 LibraryElement get library => typeDeclaration.library; 2059 LibraryElement get library => typeDeclaration.library;
2060 2060
2061 @override 2061 @override
2062 int get sourceOffset => typeDeclaration.sourceOffset; 2062 int get sourceOffset => typeDeclaration.sourceOffset;
2063 2063
2064 @override 2064 @override
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after
2412 } 2412 }
2413 2413
2414 @override 2414 @override
2415 Node get node => throw new UnsupportedError('${this}.node'); 2415 Node get node => throw new UnsupportedError('${this}.node');
2416 2416
2417 @override 2417 @override
2418 bool get hasNode => false; 2418 bool get hasNode => false;
2419 2419
2420 String toString() => 'MetadataAnnotationZ(${constant.toDartText()})'; 2420 String toString() => 'MetadataAnnotationZ(${constant.toDartText()})';
2421 } 2421 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/ordered_typeset.dart ('k') | pkg/compiler/lib/src/serialization/resolved_ast_serialization.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698