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

Side by Side Diff: pkg/compiler/lib/src/kernel/elements.dart

Issue 2896393003: Remove factory body in *.fromEnvironment, and implement this same behavior (Closed)
Patch Set: turn warning into a hint Created 3 years, 6 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) 2017, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2017, 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 /// Entity model for elements derived from Kernel IR. 5 /// Entity model for elements derived from Kernel IR.
6 6
7 import '../elements/entities.dart'; 7 import '../elements/entities.dart';
8 import '../elements/names.dart'; 8 import '../elements/names.dart';
9 import '../elements/types.dart'; 9 import '../elements/types.dart';
10 10
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 113
114 @override 114 @override
115 bool get isInstanceMember => false; 115 bool get isInstanceMember => false;
116 116
117 @override 117 @override
118 bool get isStatic => false; 118 bool get isStatic => false;
119 119
120 @override 120 @override
121 bool get isTopLevel => false; 121 bool get isTopLevel => false;
122 122
123 @override
124 bool get isFromEnvironmentConstructor => false;
125
123 String get _kind => 'constructor'; 126 String get _kind => 'constructor';
124 } 127 }
125 128
126 class KGenerativeConstructor extends KConstructor { 129 class KGenerativeConstructor extends KConstructor {
127 KGenerativeConstructor(int constructorIndex, KClass enclosingClass, Name name, 130 KGenerativeConstructor(int constructorIndex, KClass enclosingClass, Name name,
128 ParameterStructure parameterStructure, {bool isExternal, bool isConst}) 131 ParameterStructure parameterStructure, {bool isExternal, bool isConst})
129 : super(constructorIndex, enclosingClass, name, parameterStructure, 132 : super(constructorIndex, enclosingClass, name, parameterStructure,
130 isExternal: isExternal, isConst: isConst); 133 isExternal: isExternal, isConst: isConst);
131 134
132 @override 135 @override
133 bool get isFactoryConstructor => false; 136 bool get isFactoryConstructor => false;
134 137
135 @override 138 @override
136 bool get isGenerativeConstructor => true; 139 bool get isGenerativeConstructor => true;
137 } 140 }
138 141
139 class KFactoryConstructor extends KConstructor { 142 class KFactoryConstructor extends KConstructor {
143 @override
144 final bool isFromEnvironmentConstructor;
145
140 KFactoryConstructor(int memberIndex, KClass enclosingClass, Name name, 146 KFactoryConstructor(int memberIndex, KClass enclosingClass, Name name,
141 ParameterStructure parameterStructure, {bool isExternal, bool isConst}) 147 ParameterStructure parameterStructure,
148 {bool isExternal, bool isConst, this.isFromEnvironmentConstructor})
142 : super(memberIndex, enclosingClass, name, parameterStructure, 149 : super(memberIndex, enclosingClass, name, parameterStructure,
143 isExternal: isExternal, isConst: isConst); 150 isExternal: isExternal, isConst: isConst);
144 151
145 @override 152 @override
146 bool get isFactoryConstructor => true; 153 bool get isFactoryConstructor => true;
147 154
148 @override 155 @override
149 bool get isGenerativeConstructor => false; 156 bool get isGenerativeConstructor => false;
150 } 157 }
151 158
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 final MemberEntity memberContext; 233 final MemberEntity memberContext;
227 final Entity executableContext; 234 final Entity executableContext;
228 final FunctionType functionType; 235 final FunctionType functionType;
229 236
230 KLocalFunction( 237 KLocalFunction(
231 this.name, this.memberContext, this.executableContext, this.functionType); 238 this.name, this.memberContext, this.executableContext, this.functionType);
232 239
233 String toString() => 240 String toString() =>
234 'local_function(${memberContext.name}.${name ?? '<anonymous>'})'; 241 'local_function(${memberContext.name}.${name ?? '<anonymous>'})';
235 } 242 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/kernel/element_map_impl.dart ('k') | pkg/compiler/lib/src/kernel/kernel_visitor.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698