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

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

Issue 1718013002: In summaries, don't drop unsafe prefixes. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 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 | « no previous file | pkg/analyzer/test/src/summary/resynthesize_test.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 422 matching lines...) Expand 10 before | Expand all | Expand 10 after
433 _pushMap(null); 433 _pushMap(null);
434 break; 434 break;
435 case UnlinkedConstOperation.makeTypedMap: 435 case UnlinkedConstOperation.makeTypedMap:
436 TypeName keyType = _newTypeName(); 436 TypeName keyType = _newTypeName();
437 TypeName valueType = _newTypeName(); 437 TypeName valueType = _newTypeName();
438 _pushMap(AstFactory.typeArgumentList(<TypeName>[keyType, valueType])); 438 _pushMap(AstFactory.typeArgumentList(<TypeName>[keyType, valueType]));
439 break; 439 break;
440 case UnlinkedConstOperation.pushReference: 440 case UnlinkedConstOperation.pushReference:
441 EntityRef ref = uc.references[refPtr++]; 441 EntityRef ref = uc.references[refPtr++];
442 _ReferenceInfo info = resynthesizer.referenceInfos[ref.reference]; 442 _ReferenceInfo info = resynthesizer.referenceInfos[ref.reference];
443 SimpleIdentifier node = AstFactory.identifier3(info.name); 443 if (info.enclosing != null &&
444 node.staticElement = info.element; 444 info.enclosing.element != null &&
445 _push(node); 445 info.enclosing.element is! ClassElement) {
446 SimpleIdentifier prefix = AstFactory.identifier3(
447 info.enclosing.name)..staticElement = info.enclosing.element;
448 SimpleIdentifier name = AstFactory.identifier3(info.name)
449 ..staticElement = info.element;
450 PrefixedIdentifier node = AstFactory.identifier(prefix, name);
451 _push(node);
452 } else {
453 SimpleIdentifier node = AstFactory.identifier3(info.name);
454 node.staticElement = info.element;
455 _push(node);
456 }
446 break; 457 break;
447 case UnlinkedConstOperation.invokeConstructor: 458 case UnlinkedConstOperation.invokeConstructor:
448 _pushInstanceCreation(); 459 _pushInstanceCreation();
449 break; 460 break;
450 case UnlinkedConstOperation.length: 461 case UnlinkedConstOperation.length:
451 Expression target = _pop(); 462 Expression target = _pop();
452 SimpleIdentifier property = AstFactory.identifier3('length'); 463 SimpleIdentifier property = AstFactory.identifier3('length');
453 property.staticElement = 464 property.staticElement =
454 resynthesizer._buildStringLengthPropertyAccessorElement(); 465 resynthesizer._buildStringLengthPropertyAccessorElement();
455 _push(AstFactory.propertyAccess(target, property)); 466 _push(AstFactory.propertyAccess(target, property));
(...skipping 1965 matching lines...) Expand 10 before | Expand all | Expand 10 after
2421 List<DartType> typeArguments = const <DartType>[]; 2432 List<DartType> typeArguments = const <DartType>[];
2422 if (numTypeArguments != 0) { 2433 if (numTypeArguments != 0) {
2423 typeArguments = <DartType>[]; 2434 typeArguments = <DartType>[];
2424 for (int i = 0; i < numTypeArguments; i++) { 2435 for (int i = 0; i < numTypeArguments; i++) {
2425 typeArguments.add(getTypeArgument(i)); 2436 typeArguments.add(getTypeArgument(i));
2426 } 2437 }
2427 } 2438 }
2428 return typeArguments; 2439 return typeArguments;
2429 } 2440 }
2430 } 2441 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/test/src/summary/resynthesize_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698