OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 elements; | 5 library elements; |
6 | 6 |
7 import 'package:front_end/src/fasta/parser/async_modifier.dart' | 7 import 'package:front_end/src/fasta/parser/async_modifier.dart' |
8 show AsyncModifier; | 8 show AsyncModifier; |
9 | 9 |
10 import '../common.dart'; | 10 import '../common.dart'; |
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
463 element.enclosingElement != null && | 463 element.enclosingElement != null && |
464 (element.enclosingElement.kind == ElementKind.CLASS || | 464 (element.enclosingElement.kind == ElementKind.CLASS || |
465 element.enclosingElement.kind == ElementKind.COMPILATION_UNIT || | 465 element.enclosingElement.kind == ElementKind.COMPILATION_UNIT || |
466 element.enclosingElement.kind == ElementKind.LIBRARY || | 466 element.enclosingElement.kind == ElementKind.LIBRARY || |
467 element.enclosingElement.kind == ElementKind.PREFIX); | 467 element.enclosingElement.kind == ElementKind.PREFIX); |
468 } | 468 } |
469 | 469 |
470 static bool isInStaticContext(Element element) { | 470 static bool isInStaticContext(Element element) { |
471 if (isUnresolved(element)) return true; | 471 if (isUnresolved(element)) return true; |
472 if (element.enclosingElement.isClosure) { | 472 if (element.enclosingElement.isClosure) { |
473 var closureClass = element.enclosingElement; | 473 dynamic closureClass = element.enclosingElement; |
| 474 // ignore: UNDEFINED_GETTER |
474 element = closureClass.methodElement; | 475 element = closureClass.methodElement; |
475 } | 476 } |
476 Element outer = element.outermostEnclosingMemberOrTopLevel; | 477 Element outer = element.outermostEnclosingMemberOrTopLevel; |
477 if (isUnresolved(outer)) return true; | 478 if (isUnresolved(outer)) return true; |
478 if (outer.isTopLevel) return true; | 479 if (outer.isTopLevel) return true; |
479 if (outer.isGenerativeConstructor) return false; | 480 if (outer.isGenerativeConstructor) return false; |
480 if (outer.isInstanceMember) return false; | 481 if (outer.isInstanceMember) return false; |
481 return true; | 482 return true; |
482 } | 483 } |
483 | 484 |
(...skipping 1543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2027 /// by a field. | 2028 /// by a field. |
2028 bool get isDeclaredByField; | 2029 bool get isDeclaredByField; |
2029 | 2030 |
2030 /// Returns `true` if this member is abstract. | 2031 /// Returns `true` if this member is abstract. |
2031 bool get isAbstract; | 2032 bool get isAbstract; |
2032 | 2033 |
2033 /// If abstract, [implementation] points to the overridden concrete member, | 2034 /// If abstract, [implementation] points to the overridden concrete member, |
2034 /// if any. Otherwise [implementation] points to the member itself. | 2035 /// if any. Otherwise [implementation] points to the member itself. |
2035 Member get implementation; | 2036 Member get implementation; |
2036 } | 2037 } |
OLD | NEW |