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

Unified Diff: pkg/compiler/lib/src/constants/constructors.dart

Issue 1859343004: dartfmt pkg/compiler (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/compiler/lib/src/constants/constant_system.dart ('k') | pkg/compiler/lib/src/constants/evaluation.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/constants/constructors.dart
diff --git a/pkg/compiler/lib/src/constants/constructors.dart b/pkg/compiler/lib/src/constants/constructors.dart
index 7faf5933f6e2fde3a23cc1a1f8c578a1c2e1b271..c2b53fcf4cd11f9a9da5c38bcd3afc8e949cf1ad 100644
--- a/pkg/compiler/lib/src/constants/constructors.dart
+++ b/pkg/compiler/lib/src/constants/constructors.dart
@@ -5,11 +5,8 @@
library dart2js.constants.constructors;
import '../dart_types.dart';
-import '../elements/elements.dart' show
- ConstructorElement,
- FieldElement;
-import '../universe/call_structure.dart' show
- CallStructure;
+import '../elements/elements.dart' show ConstructorElement, FieldElement;
+import '../universe/call_structure.dart' show CallStructure;
import '../util/util.dart';
import 'evaluation.dart';
import 'expressions.dart';
@@ -31,8 +28,7 @@ abstract class ConstantConstructor {
/// Computes the constant expressions of the fields of the created instance
/// in a const constructor invocation with [arguments].
Map<FieldElement, ConstantExpression> computeInstanceFields(
- List<ConstantExpression> arguments,
- CallStructure callStructure);
+ List<ConstantExpression> arguments, CallStructure callStructure);
accept(ConstantConstructorVisitor visitor, arg);
}
@@ -52,16 +48,13 @@ abstract class ConstantConstructorVisitor<R, A> {
}
/// A generative constant constructor.
-class GenerativeConstantConstructor implements ConstantConstructor{
+class GenerativeConstantConstructor implements ConstantConstructor {
final InterfaceType type;
- final Map<dynamic/*int|String*/, ConstantExpression> defaultValues;
+ final Map<dynamic /*int|String*/, ConstantExpression> defaultValues;
final Map<FieldElement, ConstantExpression> fieldMap;
final ConstructedConstantExpression superConstructorInvocation;
- GenerativeConstantConstructor(
- this.type,
- this.defaultValues,
- this.fieldMap,
+ GenerativeConstantConstructor(this.type, this.defaultValues, this.fieldMap,
this.superConstructorInvocation);
ConstantConstructorKind get kind => ConstantConstructorKind.GENERATIVE;
@@ -71,14 +64,13 @@ class GenerativeConstantConstructor implements ConstantConstructor{
}
Map<FieldElement, ConstantExpression> computeInstanceFields(
- List<ConstantExpression> arguments,
- CallStructure callStructure) {
- NormalizedArguments args = new NormalizedArguments(
- defaultValues, callStructure, arguments);
+ List<ConstantExpression> arguments, CallStructure callStructure) {
+ NormalizedArguments args =
+ new NormalizedArguments(defaultValues, callStructure, arguments);
Map<FieldElement, ConstantExpression> appliedFieldMap =
applyFields(args, superConstructorInvocation);
fieldMap.forEach((FieldElement field, ConstantExpression constant) {
- appliedFieldMap[field] = constant.apply(args);
+ appliedFieldMap[field] = constant.apply(args);
});
return appliedFieldMap;
}
@@ -97,8 +89,7 @@ class GenerativeConstantConstructor implements ConstantConstructor{
bool operator ==(other) {
if (identical(this, other)) return true;
if (other is! GenerativeConstantConstructor) return false;
- return
- type == other.type &&
+ return type == other.type &&
superConstructorInvocation == other.superConstructorInvocation &&
mapEquals(defaultValues, other.defaultValues) &&
mapEquals(fieldMap, other.fieldMap);
@@ -151,25 +142,24 @@ class GenerativeConstantConstructor implements ConstantConstructor{
/// A redirecting generative constant constructor.
class RedirectingGenerativeConstantConstructor implements ConstantConstructor {
- final Map<dynamic/*int|String*/, ConstantExpression> defaultValues;
+ final Map<dynamic /*int|String*/, ConstantExpression> defaultValues;
final ConstructedConstantExpression thisConstructorInvocation;
RedirectingGenerativeConstantConstructor(
- this.defaultValues,
- this.thisConstructorInvocation);
+ this.defaultValues, this.thisConstructorInvocation);
ConstantConstructorKind get kind {
return ConstantConstructorKind.REDIRECTING_GENERATIVE;
}
InterfaceType computeInstanceType(InterfaceType newType) {
- return thisConstructorInvocation.computeInstanceType()
+ return thisConstructorInvocation
+ .computeInstanceType()
.substByContext(newType);
}
Map<FieldElement, ConstantExpression> computeInstanceFields(
- List<ConstantExpression> arguments,
- CallStructure callStructure) {
+ List<ConstantExpression> arguments, CallStructure callStructure) {
NormalizedArguments args =
new NormalizedArguments(defaultValues, callStructure, arguments);
Map<FieldElement, ConstantExpression> appliedFieldMap =
@@ -190,8 +180,7 @@ class RedirectingGenerativeConstantConstructor implements ConstantConstructor {
bool operator ==(other) {
if (identical(this, other)) return true;
if (other is! RedirectingGenerativeConstantConstructor) return false;
- return
- thisConstructorInvocation == other.thisConstructorInvocation &&
+ return thisConstructorInvocation == other.thisConstructorInvocation &&
GenerativeConstantConstructor.mapEquals(
defaultValues, other.defaultValues);
}
@@ -219,13 +208,13 @@ class RedirectingFactoryConstantConstructor implements ConstantConstructor {
}
InterfaceType computeInstanceType(InterfaceType newType) {
- return targetConstructorInvocation.computeInstanceType()
+ return targetConstructorInvocation
+ .computeInstanceType()
.substByContext(newType);
}
Map<FieldElement, ConstantExpression> computeInstanceFields(
- List<ConstantExpression> arguments,
- CallStructure callStructure) {
+ List<ConstantExpression> arguments, CallStructure callStructure) {
ConstantConstructor constantConstructor =
targetConstructorInvocation.target.constantConstructor;
return constantConstructor.computeInstanceFields(arguments, callStructure);
« no previous file with comments | « pkg/compiler/lib/src/constants/constant_system.dart ('k') | pkg/compiler/lib/src/constants/evaluation.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698