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

Side by Side Diff: pkg/kernel/lib/transformations/method_call.dart

Issue 2820323005: Run formatter on a few frontend and kernel files that hadn't been formatted. (Closed)
Patch Set: Run formatter on a few frontend and kernel files that hadn't been formatted. Created 3 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library kernel.transformations.method_call; 5 library kernel.transformations.method_call;
6 6
7 import 'dart:math' as math; 7 import 'dart:math' as math;
8 8
9 import '../ast.dart'; 9 import '../ast.dart';
10 import '../class_hierarchy.dart'; 10 import '../class_hierarchy.dart';
(...skipping 767 matching lines...) Expand 10 before | Expand all | Expand 10 after
778 List<VariableDeclaration> originalNamedParameters, 778 List<VariableDeclaration> originalNamedParameters,
779 List<VariableDeclaration> newParameterDeclarations, 779 List<VariableDeclaration> newParameterDeclarations,
780 List<VariableDeclaration> newNamedParameterDeclarations, 780 List<VariableDeclaration> newNamedParameterDeclarations,
781 List<Expression> newParameterVariableGets, 781 List<Expression> newParameterVariableGets,
782 TreeNode newStuffParent) { 782 TreeNode newStuffParent) {
783 for (final orgVar in originalParameters) { 783 for (final orgVar in originalParameters) {
784 final variableDeclaration = new VariableDeclaration(orgVar.name, 784 final variableDeclaration = new VariableDeclaration(orgVar.name,
785 initializer: orgVar.initializer, 785 initializer: orgVar.initializer,
786 type: orgVar.type, 786 type: orgVar.type,
787 isFinal: orgVar.isFinal, 787 isFinal: orgVar.isFinal,
788 isConst: orgVar.isConst)..parent = newStuffParent; 788 isConst: orgVar.isConst)
789 ..parent = newStuffParent;
789 variableDeclaration.initializer?.parent = variableDeclaration; 790 variableDeclaration.initializer?.parent = variableDeclaration;
790 newParameterDeclarations.add(variableDeclaration); 791 newParameterDeclarations.add(variableDeclaration);
791 orgVar.initializer = null; 792 orgVar.initializer = null;
792 newParameterVariableGets.add(new VariableGet(variableDeclaration)); 793 newParameterVariableGets.add(new VariableGet(variableDeclaration));
793 } 794 }
794 795
795 // Named expressions in newParameterVariableGets should be sorted 796 // Named expressions in newParameterVariableGets should be sorted
796 final tmp = new List<_Pair<String, Expression>>(); 797 final tmp = new List<_Pair<String, Expression>>();
797 for (final orgVar in originalNamedParameters) { 798 for (final orgVar in originalNamedParameters) {
798 final variableDeclaration = new VariableDeclaration(orgVar.name, 799 final variableDeclaration = new VariableDeclaration(orgVar.name,
799 initializer: orgVar.initializer, 800 initializer: orgVar.initializer,
800 type: orgVar.type, 801 type: orgVar.type,
801 isFinal: orgVar.isFinal, 802 isFinal: orgVar.isFinal,
802 isConst: orgVar.isConst)..parent = newStuffParent; 803 isConst: orgVar.isConst)
804 ..parent = newStuffParent;
803 variableDeclaration.initializer?.parent = variableDeclaration; 805 variableDeclaration.initializer?.parent = variableDeclaration;
804 newNamedParameterDeclarations.add(variableDeclaration); 806 newNamedParameterDeclarations.add(variableDeclaration);
805 orgVar.initializer = null; 807 orgVar.initializer = null;
806 tmp.add(new _Pair(orgVar.name, new VariableGet(variableDeclaration))); 808 tmp.add(new _Pair(orgVar.name, new VariableGet(variableDeclaration)));
807 } 809 }
808 tmp.sort((a, b) => a.key.compareTo(b.key)); 810 tmp.sort((a, b) => a.key.compareTo(b.key));
809 for (final item in tmp) { 811 for (final item in tmp) {
810 newParameterVariableGets.add(item.value); 812 newParameterVariableGets.add(item.value);
811 } 813 }
812 } 814 }
(...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after
1304 return printStackTrace; 1306 return printStackTrace;
1305 } 1307 }
1306 } 1308 }
1307 1309
1308 class _Pair<K, V> { 1310 class _Pair<K, V> {
1309 final K key; 1311 final K key;
1310 final V value; 1312 final V value;
1311 1313
1312 _Pair(this.key, this.value); 1314 _Pair(this.key, this.value);
1313 } 1315 }
OLDNEW
« no previous file with comments | « pkg/kernel/lib/transformations/continuation.dart ('k') | pkg/kernel/lib/transformations/mixin_full_resolution.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698