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

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

Issue 1678753002: Summarize constructor initializers. (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
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/element/element.dart'; 10 import 'package:analyzer/dart/element/element.dart';
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after
425 case UnlinkedConstOperation.invokeConstructor: 425 case UnlinkedConstOperation.invokeConstructor:
426 _pushInstanceCreation(); 426 _pushInstanceCreation();
427 break; 427 break;
428 case UnlinkedConstOperation.length: 428 case UnlinkedConstOperation.length:
429 Expression target = _pop(); 429 Expression target = _pop();
430 SimpleIdentifier property = AstFactory.identifier3('length'); 430 SimpleIdentifier property = AstFactory.identifier3('length');
431 property.staticElement = 431 property.staticElement =
432 resynthesizer._buildStringLengthPropertyAccessorElement(); 432 resynthesizer._buildStringLengthPropertyAccessorElement();
433 _push(AstFactory.propertyAccess(target, property)); 433 _push(AstFactory.propertyAccess(target, property));
434 break; 434 break;
435 case UnlinkedConstOperation.pushConstructorParameter:
436 throw new UnimplementedError('$operation');
Paul Berry 2016/02/08 14:53:12 Nit: this should have a TODO comment.
scheglov 2016/02/08 16:29:51 Done.
437 break;
435 } 438 }
436 } 439 }
437 return stack.single; 440 return stack.single;
438 } 441 }
439 442
440 TypeName _buildTypeAst(DartType type) { 443 TypeName _buildTypeAst(DartType type) {
441 if (type is DynamicTypeImpl) { 444 if (type is DynamicTypeImpl) {
442 TypeName node = AstFactory.typeName4('dynamic'); 445 TypeName node = AstFactory.typeName4('dynamic');
443 node.type = type; 446 node.type = type;
444 (node.name as SimpleIdentifier).staticElement = type.element; 447 (node.name as SimpleIdentifier).staticElement = type.element;
(...skipping 1426 matching lines...) Expand 10 before | Expand all | Expand 10 after
1871 } 1874 }
1872 : () => this.element; 1875 : () => this.element;
1873 // TODO(paulberry): Is it a bug that we have to pass `false` for 1876 // TODO(paulberry): Is it a bug that we have to pass `false` for
1874 // isInstantiated? 1877 // isInstantiated?
1875 return new DeferredFunctionTypeImpl(computer, null, typeArguments, false); 1878 return new DeferredFunctionTypeImpl(computer, null, typeArguments, false);
1876 } else { 1879 } else {
1877 return null; 1880 return null;
1878 } 1881 }
1879 } 1882 }
1880 } 1883 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698