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

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

Issue 2896393003: Remove factory body in *.fromEnvironment, and implement this same behavior (Closed)
Patch Set: turn warning into a hint 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) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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 entities; 5 library entities;
6 6
7 import '../common.dart'; 7 import '../common.dart';
8 import '../universe/call_structure.dart' show CallStructure; 8 import '../universe/call_structure.dart' show CallStructure;
9 9
10 /// Abstract interface for entities. 10 /// Abstract interface for entities.
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 /// Currently only [ConstructorElement] but later also kernel based Dart 130 /// Currently only [ConstructorElement] but later also kernel based Dart
131 /// constructors and/or Dart-in-JS constructor-like properties. 131 /// constructors and/or Dart-in-JS constructor-like properties.
132 // TODO(johnniwinther): Remove factory constructors from the set of 132 // TODO(johnniwinther): Remove factory constructors from the set of
133 // constructors. 133 // constructors.
134 abstract class ConstructorEntity extends FunctionEntity { 134 abstract class ConstructorEntity extends FunctionEntity {
135 /// Whether this is a generative constructor, possibly redirecting. 135 /// Whether this is a generative constructor, possibly redirecting.
136 bool get isGenerativeConstructor; 136 bool get isGenerativeConstructor;
137 137
138 /// Whether this is a factory constructor, possibly redirecting. 138 /// Whether this is a factory constructor, possibly redirecting.
139 bool get isFactoryConstructor; 139 bool get isFactoryConstructor;
140
141 /// Whether this is a `fromEnvironment` const constructor in `int`, `bool` or
142 /// `String`.
143 bool get isFromEnvironmentConstructor;
140 } 144 }
141 145
142 /// An entity that defines a local entity (memory slot) in generated code. 146 /// An entity that defines a local entity (memory slot) in generated code.
143 /// 147 ///
144 /// Parameters, local variables and local functions (can) define local entity 148 /// Parameters, local variables and local functions (can) define local entity
145 /// and thus implement [Local] through [LocalElement]. For non-element locals, 149 /// and thus implement [Local] through [LocalElement]. For non-element locals,
146 /// like `this` and boxes, specialized [Local] classes are created. 150 /// like `this` and boxes, specialized [Local] classes are created.
147 /// 151 ///
148 /// Type variables can introduce locals in factories and constructors 152 /// Type variables can introduce locals in factories and constructors
149 /// but since one type variable can introduce different locals in different 153 /// but since one type variable can introduce different locals in different
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 int get optionalParameters => 189 int get optionalParameters =>
186 positionalParameters - requiredParameters + namedParameters.length; 190 positionalParameters - requiredParameters + namedParameters.length;
187 191
188 /// Returns the [CallStructure] corresponding to a call site passing all 192 /// Returns the [CallStructure] corresponding to a call site passing all
189 /// parameters both required and optional. 193 /// parameters both required and optional.
190 CallStructure get callStructure { 194 CallStructure get callStructure {
191 return new CallStructure( 195 return new CallStructure(
192 positionalParameters + namedParameters.length, namedParameters); 196 positionalParameters + namedParameters.length, namedParameters);
193 } 197 }
194 } 198 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/diagnostics/messages.dart ('k') | pkg/compiler/lib/src/js_backend/backend_impact.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698