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

Side by Side Diff: pkg/analyzer/lib/src/dart/element/element.dart

Issue 1933763002: Use null-aware operators to clean up the code (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Additional clean-up Created 4 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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 analyzer.src.dart.element.element; 5 library analyzer.src.dart.element.element;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 import 'dart:math' show min; 8 import 'dart:math' show min;
9 9
10 import 'package:analyzer/dart/ast/ast.dart'; 10 import 'package:analyzer/dart/ast/ast.dart';
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 List<InterfaceType> get allSupertypes { 159 List<InterfaceType> get allSupertypes {
160 List<InterfaceType> list = new List<InterfaceType>(); 160 List<InterfaceType> list = new List<InterfaceType>();
161 _collectAllSupertypes(list); 161 _collectAllSupertypes(list);
162 return list; 162 return list;
163 } 163 }
164 164
165 @override 165 @override
166 List<ConstructorElement> get constructors { 166 List<ConstructorElement> get constructors {
167 if (!isMixinApplication) { 167 if (!isMixinApplication) {
168 assert(_constructors != null); 168 assert(_constructors != null);
169 return _constructors == null 169 return _constructors ?? ConstructorElement.EMPTY_LIST;
170 ? ConstructorElement.EMPTY_LIST
171 : _constructors;
172 } 170 }
173
174 return _computeMixinAppConstructors(); 171 return _computeMixinAppConstructors();
175 } 172 }
176 173
177 /** 174 /**
178 * Set the constructors contained in this class to the given [constructors]. 175 * Set the constructors contained in this class to the given [constructors].
179 * 176 *
180 * Should only be used for class elements that are not mixin applications. 177 * Should only be used for class elements that are not mixin applications.
181 */ 178 */
182 void set constructors(List<ConstructorElement> constructors) { 179 void set constructors(List<ConstructorElement> constructors) {
183 assert(!isMixinApplication); 180 assert(!isMixinApplication);
(...skipping 4856 matching lines...) Expand 10 before | Expand all | Expand 10 after
5040 5037
5041 @override 5038 @override
5042 void visitElement(Element element) { 5039 void visitElement(Element element) {
5043 int offset = element.nameOffset; 5040 int offset = element.nameOffset;
5044 if (offset != -1) { 5041 if (offset != -1) {
5045 map[offset] = element; 5042 map[offset] = element;
5046 } 5043 }
5047 super.visitElement(element); 5044 super.visitElement(element);
5048 } 5045 }
5049 } 5046 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/dart/constant/evaluation.dart ('k') | pkg/analyzer/lib/src/dart/element/type.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698