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

Side by Side Diff: pkg/compiler/lib/src/js_emitter/program_builder/field_visitor.dart

Issue 2982783003: Use failedAt in more places (Closed)
Patch Set: 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
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 dart2js.js_emitter.program_builder; 5 part of dart2js.js_emitter.program_builder;
6 6
7 /** 7 /**
8 * [member] is a field (instance, static, or top level). 8 * [member] is a field (instance, static, or top level).
9 * 9 *
10 * [name] is the field name that the [Namer] has picked for this field's 10 * [name] is the field name that the [Namer] has picked for this field's
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 isNativeClass = _nativeData.isNativeClass(cls); 72 isNativeClass = _nativeData.isNativeClass(cls);
73 73
74 // If the class is never instantiated we still need to set it up for 74 // If the class is never instantiated we still need to set it up for
75 // inheritance purposes, but we can simplify its JavaScript constructor. 75 // inheritance purposes, but we can simplify its JavaScript constructor.
76 isInstantiated = 76 isInstantiated =
77 _codegenWorldBuilder.directlyInstantiatedClasses.contains(cls); 77 _codegenWorldBuilder.directlyInstantiatedClasses.contains(cls);
78 } else if (library != null) { 78 } else if (library != null) {
79 isLibrary = true; 79 isLibrary = true;
80 assert(visitStatics, failedAt(library)); 80 assert(visitStatics, failedAt(library));
81 } else { 81 } else {
82 throw new SpannableAssertionFailure(NO_LOCATION_SPANNABLE, 82 failedAt(NO_LOCATION_SPANNABLE,
83 'Expected a ClassElement or a LibraryElement.'); 83 'Expected a ClassElement or a LibraryElement.');
84 } 84 }
85 85
86 void visitField(FieldEntity field, {ClassEntity holder}) { 86 void visitField(FieldEntity field, {ClassEntity holder}) {
87 assert(!(field is FieldElement && !field.isDeclaration), failedAt(field)); 87 assert(!(field is FieldElement && !field.isDeclaration), failedAt(field));
88 88
89 bool isMixinNativeField = 89 bool isMixinNativeField =
90 isNativeClass && _elementEnvironment.isMixinApplication(holder); 90 isNativeClass && _elementEnvironment.isMixinApplication(holder);
91 91
92 // See if we can dynamically create getters and setters. 92 // See if we can dynamically create getters and setters.
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 field is ClosureFieldElement; 175 field is ClosureFieldElement;
176 } 176 }
177 177
178 bool canAvoidGeneratedCheckedSetter(FieldElement member) { 178 bool canAvoidGeneratedCheckedSetter(FieldElement member) {
179 // We never generate accessors for top-level/static fields. 179 // We never generate accessors for top-level/static fields.
180 if (!member.isInstanceMember) return true; 180 if (!member.isInstanceMember) return true;
181 ResolutionDartType type = member.type; 181 ResolutionDartType type = member.type;
182 return type.treatAsDynamic || type.isObject; 182 return type.treatAsDynamic || type.isObject;
183 } 183 }
184 } 184 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/js_emitter/parameter_stub_generator.dart ('k') | pkg/compiler/lib/src/kernel/element_map_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698