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

Unified Diff: pkg/compiler/lib/src/js_emitter/program_builder/field_visitor.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/program_builder/field_visitor.dart
diff --git a/pkg/compiler/lib/src/js_emitter/program_builder/field_visitor.dart b/pkg/compiler/lib/src/js_emitter/program_builder/field_visitor.dart
index 09eabafff805dd6c5897f6d512d6c92a4a5f95b3..935fa5f9625e3eff1f423e83e23676d7e55d5ead 100644
--- a/pkg/compiler/lib/src/js_emitter/program_builder/field_visitor.dart
+++ b/pkg/compiler/lib/src/js_emitter/program_builder/field_visitor.dart
@@ -22,13 +22,13 @@ part of dart2js.js_emitter.program_builder;
* case, [needsSetter] is always false. [needsCheckedSetter] is only true when
* type assertions are enabled (checked mode).
*/
-typedef void AcceptField(VariableElement member,
- js.Name name,
- js.Name accessorName,
- bool needsGetter,
- bool needsSetter,
- bool needsCheckedSetter);
-
+typedef void AcceptField(
+ VariableElement member,
+ js.Name name,
+ js.Name accessorName,
+ bool needsGetter,
+ bool needsSetter,
+ bool needsCheckedSetter);
class FieldVisitor {
final Compiler compiler;
@@ -93,15 +93,15 @@ class FieldVisitor {
needsSetter = fieldNeedsSetter(field);
}
- if ((isInstantiated && !backend.isNative(holder))
- || needsGetter
- || needsSetter) {
+ if ((isInstantiated && !backend.isNative(holder)) ||
+ needsGetter ||
+ needsSetter) {
js.Name accessorName = namer.fieldAccessorName(field);
js.Name fieldName = namer.fieldPropertyName(field);
bool needsCheckedSetter = false;
- if (compiler.options.enableTypeAssertions
- && needsSetter
- && !canAvoidGeneratedCheckedSetter(field)) {
+ if (compiler.options.enableTypeAssertions &&
+ needsSetter &&
+ !canAvoidGeneratedCheckedSetter(field)) {
needsCheckedSetter = true;
needsSetter = false;
}
@@ -130,8 +130,8 @@ class FieldVisitor {
// generate the field getter/setter dynamically. Since this is only
// allowed on fields that are in [element] we don't need to visit
// superclasses for non-instantiated classes.
- cls.implementation.forEachInstanceField(
- visitField, includeSuperAndInjectedMembers: isInstantiated);
+ cls.implementation.forEachInstanceField(visitField,
+ includeSuperAndInjectedMembers: isInstantiated);
}
}
@@ -140,7 +140,7 @@ class FieldVisitor {
if (fieldAccessNeverThrows(field)) return false;
if (backend.shouldRetainGetter(field)) return true;
return field.isClassMember &&
- compiler.codegenWorld.hasInvokedGetter(field, compiler.world);
+ compiler.codegenWorld.hasInvokedGetter(field, compiler.world);
}
bool fieldNeedsSetter(VariableElement field) {
@@ -154,11 +154,11 @@ class FieldVisitor {
static bool fieldAccessNeverThrows(VariableElement field) {
return
- // We never access a field in a closure (a captured variable) without
- // knowing that it is there. Therefore we don't need to use a getter
- // (that will throw if the getter method is missing), but can always
- // access the field directly.
- field is ClosureFieldElement;
+ // We never access a field in a closure (a captured variable) without
+ // knowing that it is there. Therefore we don't need to use a getter
+ // (that will throw if the getter method is missing), but can always
+ // access the field directly.
+ field is ClosureFieldElement;
}
bool canAvoidGeneratedCheckedSetter(VariableElement member) {

Powered by Google App Engine
This is Rietveld 408576698