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

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

Issue 2010993002: Migrate UnlinkedParam.defaultValue to UnlinkedExecutable.bodyExpr. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: 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
« no previous file with comments | « pkg/analyzer/lib/src/summary/link.dart ('k') | pkg/analyzer/lib/src/summary/summarize_ast.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 summary_resynthesizer; 5 library summary_resynthesizer;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 8
9 import 'package:analyzer/dart/ast/ast.dart'; 9 import 'package:analyzer/dart/ast/ast.dart';
10 import 'package:analyzer/dart/ast/token.dart'; 10 import 'package:analyzer/dart/ast/token.dart';
(...skipping 2314 matching lines...) Expand 10 before | Expand all | Expand 10 after
2325 if (serializedParameter.isInitializingFormal) { 2325 if (serializedParameter.isInitializingFormal) {
2326 FieldFormalParameterElementImpl initializingParameter; 2326 FieldFormalParameterElementImpl initializingParameter;
2327 if (serializedParameter.kind == UnlinkedParamKind.required) { 2327 if (serializedParameter.kind == UnlinkedParamKind.required) {
2328 initializingParameter = new FieldFormalParameterElementImpl( 2328 initializingParameter = new FieldFormalParameterElementImpl(
2329 serializedParameter.name, nameOffset); 2329 serializedParameter.name, nameOffset);
2330 } else { 2330 } else {
2331 DefaultFieldFormalParameterElementImpl defaultParameter = 2331 DefaultFieldFormalParameterElementImpl defaultParameter =
2332 new DefaultFieldFormalParameterElementImpl( 2332 new DefaultFieldFormalParameterElementImpl(
2333 serializedParameter.name, nameOffset); 2333 serializedParameter.name, nameOffset);
2334 initializingParameter = defaultParameter; 2334 initializingParameter = defaultParameter;
2335 if (serializedParameter.defaultValue != null) { 2335 if (serializedParameter.initializer?.bodyExpr != null) {
2336 defaultParameter.constantInitializer = _buildConstExpression( 2336 defaultParameter.constantInitializer = _buildConstExpression(
2337 enclosingElement, serializedParameter.defaultValue); 2337 enclosingElement, serializedParameter.initializer.bodyExpr);
2338 defaultParameter.defaultValueCode = 2338 defaultParameter.defaultValueCode =
2339 serializedParameter.defaultValueCode; 2339 serializedParameter.defaultValueCode;
2340 } 2340 }
2341 } 2341 }
2342 parameterElement = initializingParameter; 2342 parameterElement = initializingParameter;
2343 initializingParameter.field = fields[serializedParameter.name]; 2343 initializingParameter.field = fields[serializedParameter.name];
2344 } else { 2344 } else {
2345 if (serializedParameter.kind == UnlinkedParamKind.required) { 2345 if (serializedParameter.kind == UnlinkedParamKind.required) {
2346 parameterElement = new ParameterElementImpl.forSerialized( 2346 parameterElement = new ParameterElementImpl.forSerialized(
2347 serializedParameter, enclosingElement); 2347 serializedParameter, enclosingElement);
(...skipping 614 matching lines...) Expand 10 before | Expand all | Expand 10 after
2962 static String _getElementIdentifier(String name, ReferenceKind kind) { 2962 static String _getElementIdentifier(String name, ReferenceKind kind) {
2963 if (kind == ReferenceKind.topLevelPropertyAccessor || 2963 if (kind == ReferenceKind.topLevelPropertyAccessor ||
2964 kind == ReferenceKind.propertyAccessor) { 2964 kind == ReferenceKind.propertyAccessor) {
2965 if (!name.endsWith('=')) { 2965 if (!name.endsWith('=')) {
2966 return name + '?'; 2966 return name + '?';
2967 } 2967 }
2968 } 2968 }
2969 return name; 2969 return name;
2970 } 2970 }
2971 } 2971 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/summary/link.dart ('k') | pkg/analyzer/lib/src/summary/summarize_ast.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698