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.element.element; | 5 library analyzer.src.dart.element.element; |
6 | 6 |
7 import 'dart:collection'; | 7 import 'dart:collection'; |
8 import 'dart:math' show min; | 8 import 'dart:math' show min; |
9 | 9 |
10 import 'package:analyzer/dart/ast/ast.dart'; | 10 import 'package:analyzer/dart/ast/ast.dart'; |
(...skipping 1512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1523 List<FunctionElement> functions = this.functions; | 1523 List<FunctionElement> functions = this.functions; |
1524 for (int i = 0; i < functions.length; i++) { | 1524 for (int i = 0; i < functions.length; i++) { |
1525 if (functions[i].name == FunctionElement.LOAD_LIBRARY_NAME) { | 1525 if (functions[i].name == FunctionElement.LOAD_LIBRARY_NAME) { |
1526 return true; | 1526 return true; |
1527 } | 1527 } |
1528 } | 1528 } |
1529 return false; | 1529 return false; |
1530 } | 1530 } |
1531 | 1531 |
1532 @override | 1532 @override |
1533 String get identifier => source.encoding; | 1533 String get identifier => source?.encoding; |
1534 | 1534 |
1535 @override | 1535 @override |
1536 ElementKind get kind => ElementKind.COMPILATION_UNIT; | 1536 ElementKind get kind => ElementKind.COMPILATION_UNIT; |
1537 | 1537 |
1538 @override | 1538 @override |
1539 List<ElementAnnotation> get metadata { | 1539 List<ElementAnnotation> get metadata { |
1540 if (_unlinkedPart != null) { | 1540 if (_unlinkedPart != null) { |
1541 return _metadata ??= _buildAnnotations( | 1541 return _metadata ??= _buildAnnotations( |
1542 library.definingCompilationUnit as CompilationUnitElementImpl, | 1542 library.definingCompilationUnit as CompilationUnitElementImpl, |
1543 _unlinkedPart.annotations); | 1543 _unlinkedPart.annotations); |
(...skipping 3954 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5498 } | 5498 } |
5499 for (int i = 0; i < _parts.length; i++) { | 5499 for (int i = 0; i < _parts.length; i++) { |
5500 if (_parts[i].hasLoadLibraryFunction) { | 5500 if (_parts[i].hasLoadLibraryFunction) { |
5501 return true; | 5501 return true; |
5502 } | 5502 } |
5503 } | 5503 } |
5504 return false; | 5504 return false; |
5505 } | 5505 } |
5506 | 5506 |
5507 @override | 5507 @override |
5508 String get identifier => _definingCompilationUnit.source.encoding; | 5508 String get identifier => _definingCompilationUnit.source?.encoding; |
5509 | 5509 |
5510 @override | 5510 @override |
5511 List<LibraryElement> get importedLibraries { | 5511 List<LibraryElement> get importedLibraries { |
5512 HashSet<LibraryElement> libraries = new HashSet<LibraryElement>(); | 5512 HashSet<LibraryElement> libraries = new HashSet<LibraryElement>(); |
5513 for (ImportElement element in imports) { | 5513 for (ImportElement element in imports) { |
5514 LibraryElement library = element.importedLibrary; | 5514 LibraryElement library = element.importedLibrary; |
5515 if (library != null) { | 5515 if (library != null) { |
5516 libraries.add(library); | 5516 libraries.add(library); |
5517 } | 5517 } |
5518 } | 5518 } |
(...skipping 2926 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8445 | 8445 |
8446 @override | 8446 @override |
8447 void visitElement(Element element) { | 8447 void visitElement(Element element) { |
8448 int offset = element.nameOffset; | 8448 int offset = element.nameOffset; |
8449 if (offset != -1) { | 8449 if (offset != -1) { |
8450 map[offset] = element; | 8450 map[offset] = element; |
8451 } | 8451 } |
8452 super.visitElement(element); | 8452 super.visitElement(element); |
8453 } | 8453 } |
8454 } | 8454 } |
OLD | NEW |