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

Side by Side Diff: pkg/analyzer/lib/src/generated/constant.dart

Issue 1602203004: Serialize constant initializers. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Add new summarize_const_expr.dart file. Created 4 years, 11 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/lib/src/generated/testing/element_factory.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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 analyzer.src.generated.constant; 5 library analyzer.src.generated.constant;
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/visitor.dart'; 10 import 'package:analyzer/dart/ast/visitor.dart';
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after
483 // const factory constructors in the SDK, or if the code contains 483 // const factory constructors in the SDK, or if the code contains
484 // errors (such as delegating to a non-const constructor, or delegatin g 484 // errors (such as delegating to a non-const constructor, or delegatin g
485 // to a constructor that can't be resolved). In any of these cases, 485 // to a constructor that can't be resolved). In any of these cases,
486 // we'll evaluate calls to this constructor without having to refer to 486 // we'll evaluate calls to this constructor without having to refer to
487 // any other constants. So we don't need to report any dependencies. 487 // any other constants. So we don't need to report any dependencies.
488 return; 488 return;
489 } 489 }
490 bool superInvocationFound = false; 490 bool superInvocationFound = false;
491 List<ConstructorInitializer> initializers = 491 List<ConstructorInitializer> initializers =
492 constant.constantInitializers; 492 constant.constantInitializers;
493 if (initializers == null) {
494 print('???');
Paul Berry 2016/01/19 21:39:29 Temporary debugging code I assume? Should be remo
495 }
493 for (ConstructorInitializer initializer in initializers) { 496 for (ConstructorInitializer initializer in initializers) {
494 if (initializer is SuperConstructorInvocation) { 497 if (initializer is SuperConstructorInvocation) {
495 superInvocationFound = true; 498 superInvocationFound = true;
496 } 499 }
497 initializer.accept(referenceFinder); 500 initializer.accept(referenceFinder);
498 } 501 }
499 if (!superInvocationFound) { 502 if (!superInvocationFound) {
500 // No explicit superconstructor invocation found, so we need to 503 // No explicit superconstructor invocation found, so we need to
501 // manually insert a reference to the implicit superconstructor. 504 // manually insert a reference to the implicit superconstructor.
502 InterfaceType superclass = 505 InterfaceType superclass =
(...skipping 4965 matching lines...) Expand 10 before | Expand all | Expand 10 after
5468 return BoolState.from(_element == rightElement); 5471 return BoolState.from(_element == rightElement);
5469 } else if (rightOperand is DynamicState) { 5472 } else if (rightOperand is DynamicState) {
5470 return BoolState.UNKNOWN_VALUE; 5473 return BoolState.UNKNOWN_VALUE;
5471 } 5474 }
5472 return BoolState.FALSE_STATE; 5475 return BoolState.FALSE_STATE;
5473 } 5476 }
5474 5477
5475 @override 5478 @override
5476 String toString() => _element == null ? "-unknown-" : _element.name; 5479 String toString() => _element == null ? "-unknown-" : _element.name;
5477 } 5480 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/generated/testing/element_factory.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698