[dart2js] Reformat pkg/compiler.
Change-Id: I9e379d1f0673b589139a2389c6d3602c36995cd2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/413720
Reviewed-by: Nate Biggs <natebiggs@google.com>
diff --git a/pkg/compiler/lib/src/inferrer/type_graph_inferrer.dart b/pkg/compiler/lib/src/inferrer/type_graph_inferrer.dart
index f68b292..f849af3 100644
--- a/pkg/compiler/lib/src/inferrer/type_graph_inferrer.dart
+++ b/pkg/compiler/lib/src/inferrer/type_graph_inferrer.dart
@@ -95,10 +95,8 @@
}
bool throwsAlways =
- // Always throws if the return type was inferred to be non-null empty.
- abstractValueDomain
- .isEmpty(returnType)
- .isDefinitelyTrue;
+ // Always throws if the return type was inferred to be non-null empty.
+ abstractValueDomain.isEmpty(returnType).isDefinitelyTrue;
bool isCalledOnce = typeInformation.isCalledExactlyOnce;
diff --git a/pkg/compiler/lib/src/io/position_information.dart b/pkg/compiler/lib/src/io/position_information.dart
index 2ce9749..a3c64dd 100644
--- a/pkg/compiler/lib/src/io/position_information.dart
+++ b/pkg/compiler/lib/src/io/position_information.dart
@@ -46,18 +46,15 @@
.readIndexedOrNullNoCache<SourceLocation>(
() => SourceLocation.readFromDataSource(source),
);
- List<FrameContext>? inliningContext = source
- .readIndexedOrNullNoCache<List<FrameContext>>(
- () =>
- // FrameContext must be cached since PositionSourceInformation.==
- // requires identity comparison on the objects in inliningContext.
- source
- .readList(
- () => source.readIndexed(
- () => FrameContext.readFromDataSource(source),
- ),
- ),
- );
+ List<FrameContext>?
+ inliningContext = source.readIndexedOrNullNoCache<List<FrameContext>>(
+ () =>
+ // FrameContext must be cached since PositionSourceInformation.==
+ // requires identity comparison on the objects in inliningContext.
+ source.readList(
+ () => source.readIndexed(() => FrameContext.readFromDataSource(source)),
+ ),
+ );
source.end(tag);
return PositionSourceInformation(
startPosition,
diff --git a/pkg/compiler/lib/src/ir/util.dart b/pkg/compiler/lib/src/ir/util.dart
index 96ef4e5..4344b61 100644
--- a/pkg/compiler/lib/src/ir/util.dart
+++ b/pkg/compiler/lib/src/ir/util.dart
@@ -248,10 +248,10 @@
importUri.path == 'web_gl' ||
importUri.path == 'web_sql' ||
importUri.path == 'html_common') ||
- // Mock web library path for testing.
- importUri
- .path
- .contains('native_null_assertions/web_library_interfaces.dart');
+ // Mock web library path for testing.
+ importUri.path.contains(
+ 'native_null_assertions/web_library_interfaces.dart',
+ );
bool nodeIsInWebLibrary(ir.TreeNode? node) {
if (node == null) return false;
diff --git a/pkg/compiler/lib/src/js_emitter/program_builder/collector.dart b/pkg/compiler/lib/src/js_emitter/program_builder/collector.dart
index b0ab0e7..1f7f4c8 100644
--- a/pkg/compiler/lib/src/js_emitter/program_builder/collector.dart
+++ b/pkg/compiler/lib/src/js_emitter/program_builder/collector.dart
@@ -143,10 +143,9 @@
// Compute needed classes.
Set<ClassEntity> instantiatedClasses =
- // TODO(johnniwinther): This should be accessed from a codegen closed
- // world.
- _codegenWorld
- .directlyInstantiatedClasses
+ // TODO(johnniwinther): This should be accessed from a codegen closed
+ // world.
+ _codegenWorld.directlyInstantiatedClasses
.where(computeClassFilter(backendTypeHelpers))
.toSet();
diff --git a/pkg/compiler/lib/src/js_model/js_to_frontend_map.dart b/pkg/compiler/lib/src/js_model/js_to_frontend_map.dart
index 3b4ee04..4d03385 100644
--- a/pkg/compiler/lib/src/js_model/js_to_frontend_map.dart
+++ b/pkg/compiler/lib/src/js_model/js_to_frontend_map.dart
@@ -101,8 +101,7 @@
return {
for (final member in set.map(toBackendMember))
// Members that are not live don't have a corresponding backend member.
- if (member != null)
- member,
+ if (member != null) member,
};
}
@@ -110,8 +109,7 @@
return {
for (final member in set.map(toBackendMember))
// Members that are not live don't have a corresponding backend member.
- if (member != null)
- member as FieldEntity,
+ if (member != null) member as FieldEntity,
};
}
@@ -119,8 +117,7 @@
return {
for (final member in set.map(toBackendMember))
// Members that are not live don't have a corresponding backend member.
- if (member != null)
- member as FunctionEntity,
+ if (member != null) member as FunctionEntity,
};
}
diff --git a/pkg/compiler/lib/src/js_model/js_world.dart b/pkg/compiler/lib/src/js_model/js_world.dart
index 6b46916..3de8f3d 100644
--- a/pkg/compiler/lib/src/js_model/js_world.dart
+++ b/pkg/compiler/lib/src/js_model/js_world.dart
@@ -556,21 +556,21 @@
) {
return selector.name == Identifiers.call &&
(receiver == null ||
- // This is logically equivalent to the former implementation using
- // `abstractValueDomain.contains` (which wrapped `containsMask`).
- // The switch to `abstractValueDomain.containsType` is because
- // `contains` was generally unsound but happened to work correctly
- // here. See https://dart-review.googlesource.com/c/sdk/+/130565
- // for further discussion.
- //
- // This checks if the receiver mask contains the entire type cone
- // originating from [_functionLub] and may therefore be unsound if
- // the receiver mask contains only part of the type cone. (Is this
- // possible?)
- //
- // TODO(fishythefish): Use `isDisjoint` or equivalent instead of
- // `containsType` once we can ensure it's fast enough.
- abstractValueDomain
+ // This is logically equivalent to the former implementation using
+ // `abstractValueDomain.contains` (which wrapped `containsMask`).
+ // The switch to `abstractValueDomain.containsType` is because
+ // `contains` was generally unsound but happened to work correctly
+ // here. See https://dart-review.googlesource.com/c/sdk/+/130565
+ // for further discussion.
+ //
+ // This checks if the receiver mask contains the entire type cone
+ // originating from [_functionLub] and may therefore be unsound if
+ // the receiver mask contains only part of the type cone. (Is this
+ // possible?)
+ //
+ // TODO(fishythefish): Use `isDisjoint` or equivalent instead of
+ // `containsType` once we can ensure it's fast enough.
+ abstractValueDomain
.containsType(receiver, _functionLub)
.isPotentiallyTrue);
}
diff --git a/pkg/compiler/lib/src/ssa/invoke_dynamic_specializers.dart b/pkg/compiler/lib/src/ssa/invoke_dynamic_specializers.dart
index 41b0d85..16b5049 100644
--- a/pkg/compiler/lib/src/ssa/invoke_dynamic_specializers.dart
+++ b/pkg/compiler/lib/src/ssa/invoke_dynamic_specializers.dart
@@ -241,12 +241,9 @@
}
// TODO(johnniwinther): Merge this and the following if statement.
if (index.isInteger(abstractValueDomain).isPotentiallyFalse &&
- // TODO(johnniwinther): Support annotations on the possible targets
- // and used their parameter check policy here.
- closedWorld
- .annotationsData
- .getParameterCheckPolicy(null)
- .isEmitted) {
+ // TODO(johnniwinther): Support annotations on the possible targets
+ // and used their parameter check policy here.
+ closedWorld.annotationsData.getParameterCheckPolicy(null).isEmitted) {
// We want the right checked mode error.
return null;
}
@@ -371,12 +368,9 @@
}
HInstruction index = instruction.inputs.last;
if (index.isInteger(abstractValueDomain).isPotentiallyFalse &&
- // TODO(johnniwinther): Support annotations on the possible targets
- // and used their parameter check policy here.
- closedWorld
- .annotationsData
- .getParameterCheckPolicy(null)
- .isEmitted) {
+ // TODO(johnniwinther): Support annotations on the possible targets
+ // and used their parameter check policy here.
+ closedWorld.annotationsData.getParameterCheckPolicy(null).isEmitted) {
// We want the right checked mode error.
return null;
}
diff --git a/pkg/compiler/test/closure/data/captured_variable.dart b/pkg/compiler/test/closure/data/captured_variable.dart
index 1929d81..0be3b21 100644
--- a/pkg/compiler/test/closure/data/captured_variable.dart
+++ b/pkg/compiler/test/closure/data/captured_variable.dart
@@ -22,7 +22,8 @@
/*member: readParameterInClosure:*/
readParameterInClosure(/**/ parameter) {
- /*fields=[parameter],free=[parameter]*/ func() => parameter;
+ /*fields=[parameter],free=[parameter]*/
+ func() => parameter;
return func;
}
@@ -35,7 +36,8 @@
/*member: writeParameterInClosure:box=(box0 which holds [parameter])*/
writeParameterInClosure(/*boxed*/ parameter) {
- /*fields=[box0],free=[box0,parameter]*/ func() {
+ /*fields=[box0],free=[box0,parameter]*/
+ func() {
parameter = 43;
}
@@ -51,7 +53,8 @@
/*member: readLocalInClosure:*/
readLocalInClosure(/**/ parameter) {
var /**/ local = parameter;
- /*fields=[local],free=[local]*/ func() => local;
+ /*fields=[local],free=[local]*/
+ func() => local;
return func;
}
@@ -68,7 +71,8 @@
writeLocalInClosure(/**/ parameter) {
// ignore: UNUSED_LOCAL_VARIABLE
var /*boxed*/ local = parameter;
- /*fields=[box0],free=[box0,local]*/ func() {
+ /*fields=[box0],free=[box0,local]*/
+ func() {
local = 45;
}
@@ -79,21 +83,26 @@
class Foo {
int /*member: Foo.bar:hasThis*/ bar = 4;
- /*member: Foo.baz:hasThis*/ baz() {
- /*fields=[this],free=[this],hasThis*/ func() => bar;
+ /*member: Foo.baz:hasThis*/
+ baz() {
+ /*fields=[this],free=[this],hasThis*/
+ func() => bar;
return func;
}
}
/*member: Repro.:hasThis*/
class Repro {
- /*member: Repro.qux:hasThis*/ qux() {
- /*fields=[this],free=[this],hasThis*/ threeNested(foo) =>
+ /*member: Repro.qux:hasThis*/
+ qux() {
+ /*fields=[this],free=[this],hasThis*/
+ threeNested(foo) =>
/*fields=[this],free=[this],hasThis*/ (bar) => someFunction();
return threeNested;
}
- /*member: Repro.someFunction:hasThis*/ someFunction() => 3;
+ /*member: Repro.someFunction:hasThis*/
+ someFunction() => 3;
}
main() {
diff --git a/pkg/compiler/test/codegen/model_data/dynamic_set.dart b/pkg/compiler/test/codegen/model_data/dynamic_set.dart
index f4725db..599f50e 100644
--- a/pkg/compiler/test/codegen/model_data/dynamic_set.dart
+++ b/pkg/compiler/test/codegen/model_data/dynamic_set.dart
@@ -97,8 +97,7 @@
emitted,
set=simple
*/
- int?
- field4;
+ int? field4;
}
/*member: method4:calls=[set$field4(1)],params=1*/
diff --git a/pkg/compiler/test/codegen/model_data/dynamic_set_unread.dart b/pkg/compiler/test/codegen/model_data/dynamic_set_unread.dart
index dfd5a22..c176a63 100644
--- a/pkg/compiler/test/codegen/model_data/dynamic_set_unread.dart
+++ b/pkg/compiler/test/codegen/model_data/dynamic_set_unread.dart
@@ -94,8 +94,7 @@
elided,
set=simple
*/
- int?
- field4;
+ int? field4;
}
/*member: method4:calls=[set$field4(1)],params=1*/
diff --git a/pkg/compiler/test/inference/data/closure2.dart b/pkg/compiler/test/inference/data/closure2.dart
index 2b60c2a..37ff4dd 100644
--- a/pkg/compiler/test/inference/data/closure2.dart
+++ b/pkg/compiler/test/inference/data/closure2.dart
@@ -103,9 +103,8 @@
/*current: [exact=ArrayIterator]*/
/*moveNext: [exact=ArrayIterator]*/
for (
- // ignore: unused_local_variable
- var b
- in [42]) {
+ // ignore: unused_local_variable
+ var b in [42]) {
int? bar = 42;
/*[null|exact=JSUInt31]*/
f() => bar;
diff --git a/pkg/compiler/test/sourcemaps/stacktrace/parameters.dart b/pkg/compiler/test/sourcemaps/stacktrace/parameters.dart
index 2d12e9d..b53f45e 100644
--- a/pkg/compiler/test/sourcemaps/stacktrace/parameters.dart
+++ b/pkg/compiler/test/sourcemaps/stacktrace/parameters.dart
@@ -18,22 +18,16 @@
class Class {
@pragma('dart2js:noInline')
- /*2:Class.instancePositional1[function-entry$1]*/ instancePositional1(
- a, [
- b = 42,
- c = 87,
- ]) {
+ /*2:Class.instancePositional1[function-entry$1]*/
+ instancePositional1(a, [b = 42, c = 87]) {
print('instancePositional1($a,$b,$c)');
/*3:Class.instancePositional1*/
instancePositional2(1, 2);
}
@pragma('dart2js:noInline')
- /*4:Class.instancePositional2[function-entry$2]*/ instancePositional2(
- a, [
- b = 42,
- c = 87,
- ]) {
+ /*4:Class.instancePositional2[function-entry$2]*/
+ instancePositional2(a, [b = 42, c = 87]) {
print('instancePositional2($a,$b,$c)');
/*5:Class.instancePositional2*/
instancePositional3(3, 4, 5);
@@ -47,48 +41,32 @@
}
@pragma('dart2js:noInline')
- /*7:Class.instanceNamed1[function-entry$1]*/ instanceNamed1(
- a, {
- b = 42,
- c = 87,
- d = 735,
- }) {
+ /*7:Class.instanceNamed1[function-entry$1]*/
+ instanceNamed1(a, {b = 42, c = 87, d = 735}) {
print('instanceNamed1($a,b:$b,c:$c,d:$d)');
/*8:Class.instanceNamed1*/
instanceNamed2(1, b: 2);
}
@pragma('dart2js:noInline')
- /*9:Class.instanceNamed2[function-entry$1$b]*/ instanceNamed2(
- a, {
- b = 42,
- c = 87,
- d = 735,
- }) {
+ /*9:Class.instanceNamed2[function-entry$1$b]*/
+ instanceNamed2(a, {b = 42, c = 87, d = 735}) {
print('instanceNamed2($a,b:$b,c:$c,d:$d)');
/*10:Class.instanceNamed2*/
instanceNamed3(3, c: 123);
}
@pragma('dart2js:noInline')
- /*11:Class.instanceNamed3[function-entry$1$c]*/ instanceNamed3(
- a, {
- b = 42,
- c = 87,
- d = 735,
- }) {
+ /*11:Class.instanceNamed3[function-entry$1$c]*/
+ instanceNamed3(a, {b = 42, c = 87, d = 735}) {
print('instanceNamed3($a,b:$b,c:$c,d:$d)');
/*12:Class.instanceNamed3*/
instanceNamed4(4, c: 45, b: 76);
}
@pragma('dart2js:noInline')
- /*13:Class.instanceNamed4[function-entry$1$b$c]*/ instanceNamed4(
- a, {
- b = 42,
- c = 87,
- d = 735,
- }) {
+ /*13:Class.instanceNamed4[function-entry$1$b$c]*/
+ instanceNamed4(a, {b = 42, c = 87, d = 735}) {
print('instanceNamed4($a,b:$b,c:$c,d:$d)');
/*14:Class.instanceNamed4*/
instanceNamed5(5, c: 6, b: 7, d: 8);