| 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 // This code was auto-generated, is not intended to be edited, and is subject to | 5 // This code was auto-generated, is not intended to be edited, and is subject to |
| 6 // significant change. Please see the README file for more information. | 6 // significant change. Please see the README file for more information. |
| 7 | 7 |
| 8 library engine; | 8 library engine; |
| 9 | 9 |
| 10 import 'dart:collection'; | 10 import 'dart:collection'; |
| (...skipping 1019 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1030 } | 1030 } |
| 1031 int count = sourcesToInvalidate.length; | 1031 int count = sourcesToInvalidate.length; |
| 1032 for (int i = 0; i < count; i++) { | 1032 for (int i = 0; i < count; i++) { |
| 1033 Source source = sourcesToInvalidate[i]; | 1033 Source source = sourcesToInvalidate[i]; |
| 1034 SourceEntry entry = _getReadableSourceEntry(source); | 1034 SourceEntry entry = _getReadableSourceEntry(source); |
| 1035 if (entry is DartEntry) { | 1035 if (entry is DartEntry) { |
| 1036 DartEntry dartEntry = entry; | 1036 DartEntry dartEntry = entry; |
| 1037 DartEntryImpl dartCopy = dartEntry.writableCopy; | 1037 DartEntryImpl dartCopy = dartEntry.writableCopy; |
| 1038 dartCopy.invalidateAllResolutionInformation(false); | 1038 dartCopy.invalidateAllResolutionInformation(false); |
| 1039 _cache.put(source, dartCopy); | 1039 _cache.put(source, dartCopy); |
| 1040 SourcePriority priority = SourcePriority.UNKNOWN; | 1040 _workManager.add(source, _computePriority(dartCopy)); |
| 1041 SourceKind kind = dartCopy.kind; | |
| 1042 if (kind == SourceKind.LIBRARY) { | |
| 1043 priority = SourcePriority.LIBRARY; | |
| 1044 } else if (kind == SourceKind.PART) { | |
| 1045 priority = SourcePriority.NORMAL_PART; | |
| 1046 } | |
| 1047 _workManager.add(source, priority); | |
| 1048 } else if (entry is HtmlEntry) { | 1041 } else if (entry is HtmlEntry) { |
| 1049 HtmlEntry htmlEntry = entry; | 1042 HtmlEntry htmlEntry = entry; |
| 1050 HtmlEntryImpl htmlCopy = htmlEntry.writableCopy; | 1043 HtmlEntryImpl htmlCopy = htmlEntry.writableCopy; |
| 1051 htmlCopy.invalidateAllResolutionInformation(false); | 1044 htmlCopy.invalidateAllResolutionInformation(false); |
| 1052 _cache.put(source, htmlCopy); | 1045 _cache.put(source, htmlCopy); |
| 1053 _workManager.add(source, SourcePriority.HTML); | 1046 _workManager.add(source, SourcePriority.HTML); |
| 1054 } | 1047 } |
| 1055 } | 1048 } |
| 1056 } | 1049 } |
| 1057 } | 1050 } |
| (...skipping 1479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2537 */ | 2530 */ |
| 2538 void _computeAllLibrariesDependingOn(Source library, HashSet<Source> libraries
ToInvalidate) { | 2531 void _computeAllLibrariesDependingOn(Source library, HashSet<Source> libraries
ToInvalidate) { |
| 2539 if (librariesToInvalidate.add(library)) { | 2532 if (librariesToInvalidate.add(library)) { |
| 2540 for (Source dependentLibrary in getLibrariesDependingOn(library)) { | 2533 for (Source dependentLibrary in getLibrariesDependingOn(library)) { |
| 2541 _computeAllLibrariesDependingOn(dependentLibrary, librariesToInvalidate)
; | 2534 _computeAllLibrariesDependingOn(dependentLibrary, librariesToInvalidate)
; |
| 2542 } | 2535 } |
| 2543 } | 2536 } |
| 2544 } | 2537 } |
| 2545 | 2538 |
| 2546 /** | 2539 /** |
| 2540 * Compute the priority that should be used when the source associated with th
e given entry is |
| 2541 * added to the work manager. |
| 2542 * |
| 2543 * @param dartEntry the entry associated with the source |
| 2544 * @return the priority that was computed |
| 2545 */ |
| 2546 SourcePriority _computePriority(DartEntry dartEntry) { |
| 2547 SourceKind kind = dartEntry.kind; |
| 2548 if (kind == SourceKind.LIBRARY) { |
| 2549 return SourcePriority.LIBRARY; |
| 2550 } else if (kind == SourceKind.PART) { |
| 2551 return SourcePriority.NORMAL_PART; |
| 2552 } |
| 2553 return SourcePriority.UNKNOWN; |
| 2554 } |
| 2555 |
| 2556 /** |
| 2547 * Given the encoded form of a source, use the source factory to reconstitute
the original source. | 2557 * Given the encoded form of a source, use the source factory to reconstitute
the original source. |
| 2548 * | 2558 * |
| 2549 * @param encoding the encoded form of a source | 2559 * @param encoding the encoded form of a source |
| 2550 * @return the source represented by the encoding | 2560 * @return the source represented by the encoding |
| 2551 */ | 2561 */ |
| 2552 Source _computeSourceFromEncoding(String encoding) => _sourceFactory.fromEncod
ing(encoding); | 2562 Source _computeSourceFromEncoding(String encoding) => _sourceFactory.fromEncod
ing(encoding); |
| 2553 | 2563 |
| 2554 /** | 2564 /** |
| 2555 * Return `true` if the given array of sources contains the given source. | 2565 * Return `true` if the given array of sources contains the given source. |
| 2556 * | 2566 * |
| (...skipping 690 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3247 int count = sourcesToRemove.length; | 3257 int count = sourcesToRemove.length; |
| 3248 for (int i = 0; i < count; i++) { | 3258 for (int i = 0; i < count; i++) { |
| 3249 _neededForResolution.remove(sourcesToRemove[i]); | 3259 _neededForResolution.remove(sourcesToRemove[i]); |
| 3250 } | 3260 } |
| 3251 } | 3261 } |
| 3252 // | 3262 // |
| 3253 // Look for a non-priority source that needs to be analyzed. | 3263 // Look for a non-priority source that needs to be analyzed. |
| 3254 // | 3264 // |
| 3255 List<Source> sourcesToRemove = new List<Source>(); | 3265 List<Source> sourcesToRemove = new List<Source>(); |
| 3256 WorkManager_WorkIterator sources = _workManager.iterator(); | 3266 WorkManager_WorkIterator sources = _workManager.iterator(); |
| 3257 while (sources.hasNext) { | 3267 try { |
| 3258 Source source = sources.next(); | 3268 while (sources.hasNext) { |
| 3259 AnalysisContextImpl_TaskData taskData = _getNextAnalysisTaskForSource(sour
ce, _cache.get(source), false, hintsEnabled); | 3269 Source source = sources.next(); |
| 3260 AnalysisTask task = taskData.task; | 3270 AnalysisContextImpl_TaskData taskData = _getNextAnalysisTaskForSource(so
urce, _cache.get(source), false, hintsEnabled); |
| 3261 if (task != null) { | 3271 AnalysisTask task = taskData.task; |
| 3262 int count = sourcesToRemove.length; | 3272 if (task != null) { |
| 3263 for (int i = 0; i < count; i++) { | 3273 return task; |
| 3264 _workManager.remove(sourcesToRemove[i]); | 3274 } else if (taskData.isBlocked) { |
| 3275 hasBlockedTask = true; |
| 3276 } else { |
| 3277 sourcesToRemove.add(source); |
| 3265 } | 3278 } |
| 3266 return task; | |
| 3267 } else if (taskData.isBlocked) { | |
| 3268 hasBlockedTask = true; | |
| 3269 } else { | |
| 3270 sourcesToRemove.add(source); | |
| 3271 } | 3279 } |
| 3272 } | 3280 } finally { |
| 3273 int count = sourcesToRemove.length; | 3281 int count = sourcesToRemove.length; |
| 3274 for (int i = 0; i < count; i++) { | 3282 for (int i = 0; i < count; i++) { |
| 3275 _workManager.remove(sourcesToRemove[i]); | 3283 _workManager.remove(sourcesToRemove[i]); |
| 3284 } |
| 3276 } | 3285 } |
| 3277 // // | 3286 // // |
| 3278 // // Look for a non-priority source that needs to be analyzed and was
missed by the loop above. | 3287 // // Look for a non-priority source that needs to be analyzed and was
missed by the loop above. |
| 3279 // // | 3288 // // |
| 3280 // for (Map.Entry<Source, SourceEntry> entry : cache.entrySet()) { | 3289 // for (Map.Entry<Source, SourceEntry> entry : cache.entrySet()) { |
| 3281 // source = entry.getKey(); | 3290 // source = entry.getKey(); |
| 3282 // TaskData taskData = getNextAnalysisTaskForSource(source, entry.get
Value(), false, hintsEnabled); | 3291 // TaskData taskData = getNextAnalysisTaskForSource(source, entry.get
Value(), false, hintsEnabled); |
| 3283 // AnalysisTask task = taskData.getTask(); | 3292 // AnalysisTask task = taskData.getTask(); |
| 3284 // if (task != null) { | 3293 // if (task != null) { |
| 3285 // System.out.println("Failed to analyze " + source.getFullName()); | 3294 // System.out.println("Failed to analyze " + source.getFullName()); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 3301 * <b>Note:</b> This method must only be invoked while we are synchronized on
[cacheLock]. | 3310 * <b>Note:</b> This method must only be invoked while we are synchronized on
[cacheLock]. |
| 3302 * | 3311 * |
| 3303 * @param source the source to be checked | 3312 * @param source the source to be checked |
| 3304 * @param sourceEntry the cache entry associated with the source | 3313 * @param sourceEntry the cache entry associated with the source |
| 3305 * @param isPriority `true` if the source is a priority source | 3314 * @param isPriority `true` if the source is a priority source |
| 3306 * @param hintsEnabled `true` if hints are currently enabled | 3315 * @param hintsEnabled `true` if hints are currently enabled |
| 3307 * @return the next task that needs to be performed for the given source | 3316 * @return the next task that needs to be performed for the given source |
| 3308 */ | 3317 */ |
| 3309 AnalysisContextImpl_TaskData _getNextAnalysisTaskForSource(Source source, Sour
ceEntry sourceEntry, bool isPriority, bool hintsEnabled) { | 3318 AnalysisContextImpl_TaskData _getNextAnalysisTaskForSource(Source source, Sour
ceEntry sourceEntry, bool isPriority, bool hintsEnabled) { |
| 3310 // Refuse to generate tasks for html based files that are above 1500 KB | 3319 // Refuse to generate tasks for html based files that are above 1500 KB |
| 3311 // if (sourceEntry is HtmlEntryImpl && source is FileBasedSource) { | 3320 if (_isTooBigHtmlSourceEntry(source, sourceEntry)) { |
| 3312 // // TODO (jwren) we still need to report an error of some kind back to th
e client. | 3321 // TODO (jwren) we still need to report an error of some kind back to the
client. |
| 3313 // JavaFile file = (source as FileBasedSource).file; | 3322 return new AnalysisContextImpl_TaskData(null, false); |
| 3314 // if (file.length() > (1500 * 1024)) { | 3323 } |
| 3315 // return new AnalysisContextImpl_TaskData(null, false); | |
| 3316 // } | |
| 3317 // } | |
| 3318 if (sourceEntry == null) { | 3324 if (sourceEntry == null) { |
| 3319 return new AnalysisContextImpl_TaskData(null, false); | 3325 return new AnalysisContextImpl_TaskData(null, false); |
| 3320 } | 3326 } |
| 3321 CacheState contentState = sourceEntry.getState(SourceEntry.CONTENT); | 3327 CacheState contentState = sourceEntry.getState(SourceEntry.CONTENT); |
| 3322 if (contentState == CacheState.INVALID) { | 3328 if (contentState == CacheState.INVALID) { |
| 3323 return _createGetContentTask(source, sourceEntry); | 3329 return _createGetContentTask(source, sourceEntry); |
| 3324 } else if (contentState == CacheState.IN_PROCESS) { | 3330 } else if (contentState == CacheState.IN_PROCESS) { |
| 3325 // We are already in the process of getting the content. There's nothing e
lse we can do with | 3331 // We are already in the process of getting the content. There's nothing e
lse we can do with |
| 3326 // this source until that's complete. | 3332 // this source until that's complete. |
| 3327 return new AnalysisContextImpl_TaskData(null, true); | 3333 return new AnalysisContextImpl_TaskData(null, true); |
| (...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3674 } | 3680 } |
| 3675 } | 3681 } |
| 3676 } | 3682 } |
| 3677 } | 3683 } |
| 3678 | 3684 |
| 3679 /** | 3685 /** |
| 3680 * Invalidate all of the resolution results computed by this context. | 3686 * Invalidate all of the resolution results computed by this context. |
| 3681 * | 3687 * |
| 3682 * <b>Note:</b> This method must only be invoked while we are synchronized on
[cacheLock]. | 3688 * <b>Note:</b> This method must only be invoked while we are synchronized on
[cacheLock]. |
| 3683 * | 3689 * |
| 3684 * @param invalidateUris true if the cached results of converting URIs to sour
ce files should also | 3690 * @param invalidateUris `true` if the cached results of converting URIs to so
urce files |
| 3685 * be invalidated. | 3691 * should also be invalidated. |
| 3686 */ | 3692 */ |
| 3687 void _invalidateAllLocalResolutionInformation(bool invalidateUris) { | 3693 void _invalidateAllLocalResolutionInformation(bool invalidateUris) { |
| 3688 HashMap<Source, List<Source>> oldPartMap = new HashMap<Source, List<Source>>
(); | 3694 HashMap<Source, List<Source>> oldPartMap = new HashMap<Source, List<Source>>
(); |
| 3689 MapIterator<Source, SourceEntry> iterator = _privatePartition.iterator(); | 3695 MapIterator<Source, SourceEntry> iterator = _privatePartition.iterator(); |
| 3690 while (iterator.moveNext()) { | 3696 while (iterator.moveNext()) { |
| 3691 Source source = iterator.key; | 3697 Source source = iterator.key; |
| 3692 SourceEntry sourceEntry = iterator.value; | 3698 SourceEntry sourceEntry = iterator.value; |
| 3693 if (sourceEntry is HtmlEntry) { | 3699 if (sourceEntry is HtmlEntry) { |
| 3694 HtmlEntryImpl htmlCopy = sourceEntry.writableCopy; | 3700 HtmlEntryImpl htmlCopy = sourceEntry.writableCopy; |
| 3695 htmlCopy.invalidateAllResolutionInformation(invalidateUris); | 3701 htmlCopy.invalidateAllResolutionInformation(invalidateUris); |
| 3696 iterator.value = htmlCopy; | 3702 iterator.value = htmlCopy; |
| 3703 _workManager.add(source, SourcePriority.HTML); |
| 3697 } else if (sourceEntry is DartEntry) { | 3704 } else if (sourceEntry is DartEntry) { |
| 3698 DartEntry dartEntry = sourceEntry; | 3705 DartEntry dartEntry = sourceEntry; |
| 3699 oldPartMap[source] = dartEntry.getValue(DartEntry.INCLUDED_PARTS); | 3706 oldPartMap[source] = dartEntry.getValue(DartEntry.INCLUDED_PARTS); |
| 3700 DartEntryImpl dartCopy = dartEntry.writableCopy; | 3707 DartEntryImpl dartCopy = dartEntry.writableCopy; |
| 3701 dartCopy.invalidateAllResolutionInformation(invalidateUris); | 3708 dartCopy.invalidateAllResolutionInformation(invalidateUris); |
| 3702 iterator.value = dartCopy; | 3709 iterator.value = dartCopy; |
| 3703 _workManager.add(source, SourcePriority.UNKNOWN); | 3710 _workManager.add(source, _computePriority(dartCopy)); |
| 3704 } | 3711 } |
| 3705 } | 3712 } |
| 3706 _removeFromPartsUsingMap(oldPartMap); | 3713 _removeFromPartsUsingMap(oldPartMap); |
| 3707 } | 3714 } |
| 3708 | 3715 |
| 3709 /** | 3716 /** |
| 3710 * In response to a change to Angular entry point [HtmlElement], invalidate an
y results that | 3717 * In response to a change to Angular entry point [HtmlElement], invalidate an
y results that |
| 3711 * depend on it. | 3718 * depend on it. |
| 3712 * | 3719 * |
| 3713 * <b>Note:</b> This method must only be invoked while we are synchronized on
[cacheLock]. | 3720 * <b>Note:</b> This method must only be invoked while we are synchronized on
[cacheLock]. |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3822 } | 3829 } |
| 3823 } | 3830 } |
| 3824 for (LibraryElement exported in library.exportedLibraries) { | 3831 for (LibraryElement exported in library.exportedLibraries) { |
| 3825 if (_isClient(exported, htmlSource, visitedLibraries)) { | 3832 if (_isClient(exported, htmlSource, visitedLibraries)) { |
| 3826 return true; | 3833 return true; |
| 3827 } | 3834 } |
| 3828 } | 3835 } |
| 3829 return false; | 3836 return false; |
| 3830 } | 3837 } |
| 3831 | 3838 |
| 3839 bool _isTooBigHtmlSourceEntry(Source source, SourceEntry sourceEntry) => false
; |
| 3840 |
| 3832 /** | 3841 /** |
| 3833 * Log the given debugging information. | 3842 * Log the given debugging information. |
| 3834 * | 3843 * |
| 3835 * @param message the message to be added to the log | 3844 * @param message the message to be added to the log |
| 3836 */ | 3845 */ |
| 3837 void _logInformation(String message) { | 3846 void _logInformation(String message) { |
| 3838 AnalysisEngine.instance.logger.logInformation(message); | 3847 AnalysisEngine.instance.logger.logInformation(message); |
| 3839 } | 3848 } |
| 3840 | 3849 |
| 3841 /** | 3850 /** |
| (...skipping 1083 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4925 throw new AnalysisException("A Dart file became a non-Dart file: ${sou
rce.fullName}"); | 4934 throw new AnalysisException("A Dart file became a non-Dart file: ${sou
rce.fullName}"); |
| 4926 } | 4935 } |
| 4927 } | 4936 } |
| 4928 DartEntryImpl dartCopy = dartEntry.writableCopy; | 4937 DartEntryImpl dartCopy = dartEntry.writableCopy; |
| 4929 if (thrownException == null) { | 4938 if (thrownException == null) { |
| 4930 LineInfo lineInfo = task.lineInfo; | 4939 LineInfo lineInfo = task.lineInfo; |
| 4931 dartCopy.setValue(SourceEntry.LINE_INFO, lineInfo); | 4940 dartCopy.setValue(SourceEntry.LINE_INFO, lineInfo); |
| 4932 dartCopy.setValue(DartEntry.TOKEN_STREAM, task.tokenStream); | 4941 dartCopy.setValue(DartEntry.TOKEN_STREAM, task.tokenStream); |
| 4933 dartCopy.setValue(DartEntry.SCAN_ERRORS, task.errors); | 4942 dartCopy.setValue(DartEntry.SCAN_ERRORS, task.errors); |
| 4934 _cache.storedAst(source); | 4943 _cache.storedAst(source); |
| 4935 _workManager.add(source, SourcePriority.NORMAL_PART); | |
| 4936 ChangeNoticeImpl notice = _getNotice(source); | 4944 ChangeNoticeImpl notice = _getNotice(source); |
| 4937 notice.setErrors(dartEntry.allErrors, lineInfo); | 4945 notice.setErrors(dartEntry.allErrors, lineInfo); |
| 4938 } else { | 4946 } else { |
| 4939 _removeFromParts(source, dartEntry); | 4947 _removeFromParts(source, dartEntry); |
| 4940 dartCopy.recordScanError(thrownException); | 4948 dartCopy.recordScanError(thrownException); |
| 4941 _cache.removedAst(source); | 4949 _cache.removedAst(source); |
| 4942 } | 4950 } |
| 4943 _cache.put(source, dartCopy); | 4951 _cache.put(source, dartCopy); |
| 4944 dartEntry = dartCopy; | 4952 dartEntry = dartCopy; |
| 4945 } else { | 4953 } else { |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5059 bool _sourceAvailable(Source source) { | 5067 bool _sourceAvailable(Source source) { |
| 5060 SourceEntry sourceEntry = _cache.get(source); | 5068 SourceEntry sourceEntry = _cache.get(source); |
| 5061 if (sourceEntry == null) { | 5069 if (sourceEntry == null) { |
| 5062 sourceEntry = _createSourceEntry(source, true); | 5070 sourceEntry = _createSourceEntry(source, true); |
| 5063 } else { | 5071 } else { |
| 5064 _sourceChanged(source); | 5072 _sourceChanged(source); |
| 5065 sourceEntry = _cache.get(source); | 5073 sourceEntry = _cache.get(source); |
| 5066 } | 5074 } |
| 5067 if (sourceEntry is HtmlEntry) { | 5075 if (sourceEntry is HtmlEntry) { |
| 5068 _workManager.add(source, SourcePriority.HTML); | 5076 _workManager.add(source, SourcePriority.HTML); |
| 5069 } else { | 5077 } else if (sourceEntry is DartEntry) { |
| 5070 _workManager.add(source, SourcePriority.UNKNOWN); | 5078 _workManager.add(source, _computePriority(sourceEntry as DartEntry)); |
| 5071 } | 5079 } |
| 5072 return sourceEntry is DartEntry; | 5080 return sourceEntry is DartEntry; |
| 5073 } | 5081 } |
| 5074 | 5082 |
| 5075 /** | 5083 /** |
| 5076 * <b>Note:</b> This method must only be invoked while we are synchronized on
[cacheLock]. | 5084 * <b>Note:</b> This method must only be invoked while we are synchronized on
[cacheLock]. |
| 5077 * | 5085 * |
| 5078 * @param source the source that has been changed | 5086 * @param source the source that has been changed |
| 5079 */ | 5087 */ |
| 5080 void _sourceChanged(Source source) { | 5088 void _sourceChanged(Source source) { |
| (...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5588 } | 5596 } |
| 5589 | 5597 |
| 5590 /** | 5598 /** |
| 5591 * Create an object to represent the information about the library defined by
the compilation | 5599 * Create an object to represent the information about the library defined by
the compilation |
| 5592 * unit with the given source. | 5600 * unit with the given source. |
| 5593 * | 5601 * |
| 5594 * @param librarySource the source of the library's defining compilation unit | 5602 * @param librarySource the source of the library's defining compilation unit |
| 5595 * @return the library object that was created | 5603 * @return the library object that was created |
| 5596 */ | 5604 */ |
| 5597 ResolvableLibrary _createLibraryOrNull(Source librarySource) { | 5605 ResolvableLibrary _createLibraryOrNull(Source librarySource) { |
| 5598 if (!AnalysisContextImpl_this.exists(librarySource)) { | |
| 5599 return null; | |
| 5600 } | |
| 5601 ResolvableLibrary library = new ResolvableLibrary(librarySource); | 5606 ResolvableLibrary library = new ResolvableLibrary(librarySource); |
| 5602 SourceEntry sourceEntry = AnalysisContextImpl_this._cache.get(librarySource)
; | 5607 SourceEntry sourceEntry = AnalysisContextImpl_this._cache.get(librarySource)
; |
| 5603 if (sourceEntry is DartEntry) { | 5608 if (sourceEntry is DartEntry) { |
| 5604 LibraryElementImpl libraryElement = sourceEntry.getValue(DartEntry.ELEMENT
) as LibraryElementImpl; | 5609 LibraryElementImpl libraryElement = sourceEntry.getValue(DartEntry.ELEMENT
) as LibraryElementImpl; |
| 5605 if (libraryElement != null) { | 5610 if (libraryElement != null) { |
| 5606 library.libraryElement = libraryElement; | 5611 library.libraryElement = libraryElement; |
| 5607 } | 5612 } |
| 5608 } | 5613 } |
| 5609 _libraryMap[librarySource] = library; | 5614 _libraryMap[librarySource] = library; |
| 5610 return library; | 5615 return library; |
| (...skipping 7041 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12652 * @param message an explanation of why the error occurred or what it means | 12657 * @param message an explanation of why the error occurred or what it means |
| 12653 */ | 12658 */ |
| 12654 void logError(String message); | 12659 void logError(String message); |
| 12655 | 12660 |
| 12656 /** | 12661 /** |
| 12657 * Log the given exception as one representing an error. | 12662 * Log the given exception as one representing an error. |
| 12658 * | 12663 * |
| 12659 * @param message an explanation of why the error occurred or what it means | 12664 * @param message an explanation of why the error occurred or what it means |
| 12660 * @param exception the exception being logged | 12665 * @param exception the exception being logged |
| 12661 */ | 12666 */ |
| 12662 void logError2(String message, exception); | 12667 void logError2(String message, Exception exception); |
| 12663 | 12668 |
| 12664 /** | 12669 /** |
| 12665 * Log the given informational message. | 12670 * Log the given informational message. |
| 12666 * | 12671 * |
| 12667 * @param message an explanation of why the error occurred or what it means | 12672 * @param message an explanation of why the error occurred or what it means |
| 12668 * @param exception the exception being logged | 12673 * @param exception the exception being logged |
| 12669 */ | 12674 */ |
| 12670 void logInformation(String message); | 12675 void logInformation(String message); |
| 12671 | 12676 |
| 12672 /** | 12677 /** |
| 12673 * Log the given exception as one representing an informational message. | 12678 * Log the given exception as one representing an informational message. |
| 12674 * | 12679 * |
| 12675 * @param message an explanation of why the error occurred or what it means | 12680 * @param message an explanation of why the error occurred or what it means |
| 12676 * @param exception the exception being logged | 12681 * @param exception the exception being logged |
| 12677 */ | 12682 */ |
| 12678 void logInformation2(String message, Exception exception); | 12683 void logInformation2(String message, Exception exception); |
| 12679 } | 12684 } |
| 12680 | 12685 |
| 12681 /** | 12686 /** |
| 12682 * Implementation of [Logger] that does nothing. | 12687 * Implementation of [Logger] that does nothing. |
| 12683 */ | 12688 */ |
| 12684 class Logger_NullLogger implements Logger { | 12689 class Logger_NullLogger implements Logger { |
| 12685 @override | 12690 @override |
| 12686 void logError(String message) { | 12691 void logError(String message) { |
| 12687 } | 12692 } |
| 12688 | 12693 |
| 12689 @override | 12694 @override |
| 12690 void logError2(String message, exception) { | 12695 void logError2(String message, Exception exception) { |
| 12691 } | 12696 } |
| 12692 | 12697 |
| 12693 @override | 12698 @override |
| 12694 void logInformation(String message) { | 12699 void logInformation(String message) { |
| 12695 } | 12700 } |
| 12696 | 12701 |
| 12697 @override | 12702 @override |
| 12698 void logInformation2(String message, exception) { | 12703 void logInformation2(String message, Exception exception) { |
| 12699 } | 12704 } |
| 12700 } | 12705 } |
| 12701 | 12706 |
| 12702 /** | 12707 /** |
| 12703 * [NgComponentElementProcessor] applies [AngularComponentElement] by parsing ma
pped | 12708 * [NgComponentElementProcessor] applies [AngularComponentElement] by parsing ma
pped |
| 12704 * attributes as expressions. | 12709 * attributes as expressions. |
| 12705 */ | 12710 */ |
| 12706 class NgComponentElementProcessor extends NgDirectiveProcessor { | 12711 class NgComponentElementProcessor extends NgDirectiveProcessor { |
| 12707 final AngularComponentElement _element; | 12712 final AngularComponentElement _element; |
| 12708 | 12713 |
| (...skipping 2723 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 15432 * attempt to discover the underlying cause of a long-standing bug. | 15437 * attempt to discover the underlying cause of a long-standing bug. |
| 15433 * | 15438 * |
| 15434 * @param newState the new state of the content | 15439 * @param newState the new state of the content |
| 15435 * @return the new state of the content | 15440 * @return the new state of the content |
| 15436 */ | 15441 */ |
| 15437 CacheState _checkContentState(CacheState newState) { | 15442 CacheState _checkContentState(CacheState newState) { |
| 15438 if (_contentState == CacheState.ERROR) { | 15443 if (_contentState == CacheState.ERROR) { |
| 15439 InstrumentationBuilder builder = Instrumentation.builder2("SourceEntryImpl
-checkContentState"); | 15444 InstrumentationBuilder builder = Instrumentation.builder2("SourceEntryImpl
-checkContentState"); |
| 15440 builder.data3("message", "contentState changing from ${_contentState} to $
{newState}"); | 15445 builder.data3("message", "contentState changing from ${_contentState} to $
{newState}"); |
| 15441 //builder.data("source", source.getFullName()); | 15446 //builder.data("source", source.getFullName()); |
| 15442 builder.record(new AnalysisException()); | 15447 builder.record(new CaughtException(new AnalysisException(), null)); |
| 15443 builder.log(); | 15448 builder.log(); |
| 15444 } | 15449 } |
| 15445 return newState; | 15450 return newState; |
| 15446 } | 15451 } |
| 15447 } | 15452 } |
| 15448 | 15453 |
| 15449 /** | 15454 /** |
| 15450 * The enumerated type `Priority` defines the priority levels used to return sou
rces in an | 15455 * The enumerated type `Priority` defines the priority levels used to return sou
rces in an |
| 15451 * optimal order. A smaller ordinal value equates to a higher priority. | 15456 * optimal order. A smaller ordinal value equates to a higher priority. |
| 15452 */ | 15457 */ |
| (...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 15734 void _advance() { | 15739 void _advance() { |
| 15735 _index++; | 15740 _index++; |
| 15736 if (_index >= WorkManager_this._workQueues[_queueIndex].length) { | 15741 if (_index >= WorkManager_this._workQueues[_queueIndex].length) { |
| 15737 _index = 0; | 15742 _index = 0; |
| 15738 _queueIndex++; | 15743 _queueIndex++; |
| 15739 while (_queueIndex < WorkManager_this._workQueues.length && WorkManager_th
is._workQueues[_queueIndex].isEmpty) { | 15744 while (_queueIndex < WorkManager_this._workQueues.length && WorkManager_th
is._workQueues[_queueIndex].isEmpty) { |
| 15740 _queueIndex++; | 15745 _queueIndex++; |
| 15741 } | 15746 } |
| 15742 } | 15747 } |
| 15743 } | 15748 } |
| 15744 } | 15749 } |
| OLD | NEW |