Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 Loading... | |
| 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 } |
| OLD | NEW |