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

Unified Diff: pkg/compiler/lib/src/js_emitter/metadata_collector.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
Index: pkg/compiler/lib/src/js_emitter/metadata_collector.dart
diff --git a/pkg/compiler/lib/src/js_emitter/metadata_collector.dart b/pkg/compiler/lib/src/js_emitter/metadata_collector.dart
index b51c470e6f7e61f113debe05117e6dc6e7992bd2..0fc56db8a30a1123c1c38bcfb24f12cc73418bd1 100644
--- a/pkg/compiler/lib/src/js_emitter/metadata_collector.dart
+++ b/pkg/compiler/lib/src/js_emitter/metadata_collector.dart
@@ -63,9 +63,9 @@ class _ForwardingMetadataEntry extends _MetadataEntry implements Placeholder {
_ForwardingMetadataEntry([this.debug]);
_MetadataEntry get forwardTo {
- assert(isBound);
- return _forwardTo;
- }
+ assert(isBound);
+ return _forwardTo;
+ }
jsAst.Expression get entry {
assert(isBound);
@@ -172,8 +172,8 @@ class MetadataCollector implements jsAst.TokenFinalizer {
}
}
if (metadata.isEmpty) return null;
- return js('function() { return # }',
- new jsAst.ArrayInitializer(metadata));
+ return js(
+ 'function() { return # }', new jsAst.ArrayInitializer(metadata));
});
}
@@ -193,7 +193,7 @@ class MetadataCollector implements jsAst.TokenFinalizer {
ConstructorElement constructor = function;
while (constructor.isRedirectingFactory &&
- !constructor.isCyclicRedirection) {
+ !constructor.isCyclicRedirection) {
// TODO(sra): Remove the loop once effectiveTarget forwards to patches.
constructor = constructor.effectiveTarget.implementation;
}
@@ -222,8 +222,7 @@ class MetadataCollector implements jsAst.TokenFinalizer {
return defaultValues;
}
- Map<ParameterElement, ParameterElement>
- mapRedirectingFactoryConstructorOptionalParameters(
+ Map<ParameterElement, ParameterElement> mapRedirectingFactoryConstructorOptionalParameters(
FunctionSignature source, FunctionSignature target) {
var map = <ParameterElement, ParameterElement>{};
@@ -247,8 +246,8 @@ class MetadataCollector implements jsAst.TokenFinalizer {
int i = source.requiredParameterCount;
for (ParameterElement element in source.orderedOptionalParameters) {
if (i >= target.requiredParameterCount && i < target.parameterCount) {
- map[element] =
- target.orderedOptionalParameters[i - target.requiredParameterCount];
+ map[element] = target.orderedOptionalParameters[
+ i - target.requiredParameterCount];
}
++i;
}
@@ -267,16 +266,15 @@ class MetadataCollector implements jsAst.TokenFinalizer {
}
jsAst.Expression reifyType(DartType type, {ignoreTypeVariables: false}) {
- return reifyTypeForOutputUnit(type,
- _compiler.deferredLoadTask.mainOutputUnit,
- ignoreTypeVariables: ignoreTypeVariables);
+ return reifyTypeForOutputUnit(
+ type, _compiler.deferredLoadTask.mainOutputUnit,
+ ignoreTypeVariables: ignoreTypeVariables);
}
- jsAst.Expression reifyTypeForOutputUnit(DartType type,
- OutputUnit outputUnit,
- {ignoreTypeVariables: false}) {
+ jsAst.Expression reifyTypeForOutputUnit(DartType type, OutputUnit outputUnit,
+ {ignoreTypeVariables: false}) {
return addTypeInOutputUnit(type, outputUnit,
- ignoreTypeVariables: ignoreTypeVariables);
+ ignoreTypeVariables: ignoreTypeVariables);
}
jsAst.Expression reifyName(String name) {
@@ -293,8 +291,8 @@ class MetadataCollector implements jsAst.TokenFinalizer {
_MetadataEntry _addGlobalMetadata(jsAst.Node node) {
String nameToKey(jsAst.Name name) => "${name.key}";
- String printed = jsAst.prettyPrint(
- node, _compiler, renamerForNames: nameToKey);
+ String printed =
+ jsAst.prettyPrint(node, _compiler, renamerForNames: nameToKey);
return _globalMetadataMap.putIfAbsent(printed, () {
_BoundMetadataEntry result = new _BoundMetadataEntry(node);
if (_compiler.options.hasIncrementalSupport) {
@@ -305,16 +303,14 @@ class MetadataCollector implements jsAst.TokenFinalizer {
}
jsAst.Expression _computeTypeRepresentation(DartType type,
- {ignoreTypeVariables: false}) {
- jsAst.Expression representation = _backend.rtiEncoder.getTypeRepresentation(
- type,
- (variable) {
- if (ignoreTypeVariables) return new jsAst.LiteralNull();
- return _typeVariableHandler.reifyTypeVariable(variable.element);
- },
- (TypedefType typedef) {
- return _backend.isAccessibleByReflection(typedef.element);
- });
+ {ignoreTypeVariables: false}) {
+ jsAst.Expression representation =
+ _backend.rtiEncoder.getTypeRepresentation(type, (variable) {
+ if (ignoreTypeVariables) return new jsAst.LiteralNull();
+ return _typeVariableHandler.reifyTypeVariable(variable.element);
+ }, (TypedefType typedef) {
+ return _backend.isAccessibleByReflection(typedef.element);
+ });
if (representation is jsAst.LiteralString) {
// We don't want the representation to be a string, since we use
@@ -324,19 +320,17 @@ class MetadataCollector implements jsAst.TokenFinalizer {
}
return representation;
-
}
- jsAst.Expression addTypeInOutputUnit(DartType type,
- OutputUnit outputUnit,
- {ignoreTypeVariables: false}) {
+ jsAst.Expression addTypeInOutputUnit(DartType type, OutputUnit outputUnit,
+ {ignoreTypeVariables: false}) {
if (_typesMap[outputUnit] == null) {
_typesMap[outputUnit] = new Map<DartType, _BoundMetadataEntry>();
}
return _typesMap[outputUnit].putIfAbsent(type, () {
_BoundMetadataEntry result = new _BoundMetadataEntry(
_computeTypeRepresentation(type,
- ignoreTypeVariables: ignoreTypeVariables));
+ ignoreTypeVariables: ignoreTypeVariables));
if (_compiler.options.hasIncrementalSupport) {
result.finalize(_globalTypesCounter++);
}
@@ -369,9 +363,10 @@ class MetadataCollector implements jsAst.TokenFinalizer {
}
void countTokensInTypes(Iterable<_BoundMetadataEntry> entries) {
jsAst.TokenCounter counter = new jsAst.TokenCounter();
- entries.where((_BoundMetadataEntry e) => e._rc > 0)
- .map((_BoundMetadataEntry e) => e.entry)
- .forEach(counter.countTokens);
+ entries
+ .where((_BoundMetadataEntry e) => e._rc > 0)
+ .map((_BoundMetadataEntry e) => e.entry)
+ .forEach(counter.countTokens);
}
jsAst.ArrayInitializer finalizeMap(Map<dynamic, _BoundMetadataEntry> map) {
@@ -394,7 +389,7 @@ class MetadataCollector implements jsAst.TokenFinalizer {
List<jsAst.Node> values =
entries.map((_BoundMetadataEntry e) => e.entry).toList();
- return new jsAst.ArrayInitializer(values);
+ return new jsAst.ArrayInitializer(values);
}
_globalMetadata.setExpression(finalizeMap(_globalMetadataMap));
« no previous file with comments | « pkg/compiler/lib/src/js_emitter/main_call_stub_generator.dart ('k') | pkg/compiler/lib/src/js_emitter/model.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698