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

Side by Side Diff: pkg/analyzer/lib/src/summary/summarize_ast.dart

Issue 2013883003: Migrate UnlinkedVariable.constExpr to UnlinkedExecutable.bodyExpr. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Fix a comment Created 4 years, 6 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) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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 serialization.summarize_ast; 5 library serialization.summarize_ast;
6 6
7 import 'package:analyzer/dart/ast/ast.dart'; 7 import 'package:analyzer/dart/ast/ast.dart';
8 import 'package:analyzer/dart/ast/token.dart'; 8 import 'package:analyzer/dart/ast/token.dart';
9 import 'package:analyzer/dart/ast/visitor.dart'; 9 import 'package:analyzer/dart/ast/visitor.dart';
10 import 'package:analyzer/dart/element/type.dart' show DartType; 10 import 'package:analyzer/dart/element/type.dart' show DartType;
(...skipping 883 matching lines...) Expand 10 before | Expand all | Expand 10 after
894 b.annotations = serializeAnnotations(annotations); 894 b.annotations = serializeAnnotations(annotations);
895 b.codeRange = serializeCodeRange(variables.parent); 895 b.codeRange = serializeCodeRange(variables.parent);
896 Map<int, int> localClosureIndexMap = _withLocalClosureIndexMap(() { 896 Map<int, int> localClosureIndexMap = _withLocalClosureIndexMap(() {
897 b.initializer = serializeInitializerFunction(variable.initializer); 897 b.initializer = serializeInitializerFunction(variable.initializer);
898 }); 898 });
899 if (variable.isConst || 899 if (variable.isConst ||
900 variable.isFinal && isField && !isDeclaredStatic || 900 variable.isFinal && isField && !isDeclaredStatic ||
901 variables.type == null) { 901 variables.type == null) {
902 Expression initializer = variable.initializer; 902 Expression initializer = variable.initializer;
903 if (initializer != null) { 903 if (initializer != null) {
904 b.constExpr = serializeConstExpr(localClosureIndexMap, initializer); 904 b.initializer.bodyExpr =
905 serializeConstExpr(localClosureIndexMap, initializer);
905 } 906 }
906 } 907 }
907 if (variable.initializer != null && 908 if (variable.initializer != null &&
908 (variables.isFinal || variables.isConst)) { 909 (variables.isFinal || variables.isConst)) {
909 b.propagatedTypeSlot = assignSlot(); 910 b.propagatedTypeSlot = assignSlot();
910 } 911 }
911 bool isSemanticallyStatic = !isField || isDeclaredStatic; 912 bool isSemanticallyStatic = !isField || isDeclaredStatic;
912 if (variables.type == null && 913 if (variables.type == null &&
913 (variable.initializer != null || !isSemanticallyStatic)) { 914 (variable.initializer != null || !isSemanticallyStatic)) {
914 b.inferredTypeSlot = assignSlot(); 915 b.inferredTypeSlot = assignSlot();
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after
1342 /** 1343 /**
1343 * A [_TypeParameterScope] is a [_Scope] which defines [_ScopedTypeParameter]s. 1344 * A [_TypeParameterScope] is a [_Scope] which defines [_ScopedTypeParameter]s.
1344 */ 1345 */
1345 class _TypeParameterScope extends _Scope { 1346 class _TypeParameterScope extends _Scope {
1346 /** 1347 /**
1347 * Get the number of [_ScopedTypeParameter]s defined in this 1348 * Get the number of [_ScopedTypeParameter]s defined in this
1348 * [_TypeParameterScope]. 1349 * [_TypeParameterScope].
1349 */ 1350 */
1350 int get length => _definedNames.length; 1351 int get length => _definedNames.length;
1351 } 1352 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/summary/resynthesize.dart ('k') | pkg/analyzer/lib/src/summary/summarize_elements.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698