| 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.dart.constant.utilities; | 5 library analyzer.src.dart.constant.utilities; |
| 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 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 super.visitRedirectingConstructorInvocation(node); | 283 super.visitRedirectingConstructorInvocation(node); |
| 284 ConstructorElement target = getConstructorImpl(node.staticElement); | 284 ConstructorElement target = getConstructorImpl(node.staticElement); |
| 285 if (target != null) { | 285 if (target != null) { |
| 286 _callback(target); | 286 _callback(target); |
| 287 } | 287 } |
| 288 return null; | 288 return null; |
| 289 } | 289 } |
| 290 | 290 |
| 291 @override | 291 @override |
| 292 Object visitSimpleIdentifier(SimpleIdentifier node) { | 292 Object visitSimpleIdentifier(SimpleIdentifier node) { |
| 293 Element element = node.staticElement; | 293 Element staticElement = node.staticElement; |
| 294 if (element is PropertyAccessorElement) { | 294 Element element = staticElement is PropertyAccessorElement |
| 295 element = (element as PropertyAccessorElement).variable; | 295 ? staticElement.variable |
| 296 } | 296 : staticElement; |
| 297 if (element is VariableElement && element.isConst) { | 297 if (element is VariableElement && element.isConst) { |
| 298 _callback(element); | 298 _callback(element); |
| 299 } | 299 } |
| 300 return null; | 300 return null; |
| 301 } | 301 } |
| 302 | 302 |
| 303 @override | 303 @override |
| 304 Object visitSuperConstructorInvocation(SuperConstructorInvocation node) { | 304 Object visitSuperConstructorInvocation(SuperConstructorInvocation node) { |
| 305 super.visitSuperConstructorInvocation(node); | 305 super.visitSuperConstructorInvocation(node); |
| 306 ConstructorElement constructor = getConstructorImpl(node.staticElement); | 306 ConstructorElement constructor = getConstructorImpl(node.staticElement); |
| 307 if (constructor != null) { | 307 if (constructor != null) { |
| 308 _callback(constructor); | 308 _callback(constructor); |
| 309 } | 309 } |
| 310 return null; | 310 return null; |
| 311 } | 311 } |
| 312 } | 312 } |
| OLD | NEW |