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

Unified Diff: pkg/compiler/lib/src/resolution/variables.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/resolution/variables.dart
diff --git a/pkg/compiler/lib/src/resolution/variables.dart b/pkg/compiler/lib/src/resolution/variables.dart
index aec67f3afdf3d20e9bbd105ed962184c4e2af013..c5609a8398c3ff8d449c91a4cf8c436c7c904786 100644
--- a/pkg/compiler/lib/src/resolution/variables.dart
+++ b/pkg/compiler/lib/src/resolution/variables.dart
@@ -5,37 +5,25 @@
library dart2js.resolution.variables;
import '../common.dart';
-import '../compiler.dart' show
- Compiler;
-import '../elements/modelx.dart' show
- LocalVariableElementX,
- VariableList;
+import '../compiler.dart' show Compiler;
+import '../elements/modelx.dart' show LocalVariableElementX, VariableList;
import '../tree/tree.dart';
-import '../universe/use.dart' show
- TypeUse;
-import '../util/util.dart' show
- Link;
+import '../universe/use.dart' show TypeUse;
+import '../util/util.dart' show Link;
-import 'members.dart' show
- ResolverVisitor;
-import 'registry.dart' show
- ResolutionRegistry;
-import 'resolution_common.dart' show
- CommonResolverVisitor;
-import 'scope.dart' show
- VariableDefinitionScope;
+import 'members.dart' show ResolverVisitor;
+import 'registry.dart' show ResolutionRegistry;
+import 'resolution_common.dart' show CommonResolverVisitor;
+import 'scope.dart' show VariableDefinitionScope;
class VariableDefinitionsVisitor extends CommonResolverVisitor<Identifier> {
VariableDefinitions definitions;
ResolverVisitor resolver;
VariableList variables;
- VariableDefinitionsVisitor(Compiler compiler,
- this.definitions,
- this.resolver,
- this.variables)
- : super(compiler) {
- }
+ VariableDefinitionsVisitor(
+ Compiler compiler, this.definitions, this.resolver, this.variables)
+ : super(compiler) {}
ResolutionRegistry get registry => resolver.registry;
@@ -47,9 +35,8 @@ class VariableDefinitionsVisitor extends CommonResolverVisitor<Identifier> {
new VariableDefinitionScope(resolver.scope, name);
resolver.visitIn(node.arguments.head, scope);
if (scope.variableReferencedInInitializer) {
- reporter.reportErrorMessage(
- identifier, MessageKind.REFERENCE_IN_INITIALIZATION,
- {'variableName': name});
+ reporter.reportErrorMessage(identifier,
+ MessageKind.REFERENCE_IN_INITIALIZATION, {'variableName': name});
}
return identifier;
}
@@ -61,17 +48,14 @@ class VariableDefinitionsVisitor extends CommonResolverVisitor<Identifier> {
new TypeUse.instantiation(compiler.coreTypes.nullType));
if (definitions.modifiers.isConst) {
if (resolver.inLoopVariable) {
- reporter.reportErrorMessage(
- node, MessageKind.CONST_LOOP_VARIABLE);
+ reporter.reportErrorMessage(node, MessageKind.CONST_LOOP_VARIABLE);
} else {
reporter.reportErrorMessage(
node, MessageKind.CONST_WITHOUT_INITIALIZER);
}
}
- if (definitions.modifiers.isFinal &&
- !resolver.inLoopVariable) {
- reporter.reportErrorMessage(
- node, MessageKind.FINAL_WITHOUT_INITIALIZER);
+ if (definitions.modifiers.isFinal && !resolver.inLoopVariable) {
+ reporter.reportErrorMessage(node, MessageKind.FINAL_WITHOUT_INITIALIZER);
}
return node;
}
@@ -80,8 +64,7 @@ class VariableDefinitionsVisitor extends CommonResolverVisitor<Identifier> {
for (Link<Node> link = node.nodes; !link.isEmpty; link = link.tail) {
Identifier name = visit(link.head);
LocalVariableElementX element = new LocalVariableElementX(
- name.source, resolver.enclosingElement,
- variables, name.token);
+ name.source, resolver.enclosingElement, variables, name.token);
resolver.defineLocalVariable(link.head, element);
resolver.addToScope(element);
if (definitions.modifiers.isConst) {
« no previous file with comments | « pkg/compiler/lib/src/resolution/typedefs.dart ('k') | pkg/compiler/lib/src/scanner/array_based_scanner.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698