mirror of
https://github.com/dart-lang/sdk
synced 2024-09-16 04:37:12 +00:00
Fix null pointer (issue 24790)
R=scheglov@google.com Review URL: https://codereview.chromium.org/1426943005 .
This commit is contained in:
parent
ef5f949c86
commit
323ce5d693
|
@ -1048,13 +1048,17 @@ class AnalysisContextImpl implements InternalAnalysisContext {
|
|||
@override
|
||||
bool isClientLibrary(Source librarySource) {
|
||||
CacheEntry entry = _cache.get(librarySource);
|
||||
return _referencesDartHtml(librarySource) && entry.getValue(IS_LAUNCHABLE);
|
||||
return entry != null &&
|
||||
_referencesDartHtml(librarySource) &&
|
||||
entry.getValue(IS_LAUNCHABLE);
|
||||
}
|
||||
|
||||
@override
|
||||
bool isServerLibrary(Source librarySource) {
|
||||
CacheEntry entry = _cache.get(librarySource);
|
||||
return !_referencesDartHtml(librarySource) && entry.getValue(IS_LAUNCHABLE);
|
||||
return entry != null &&
|
||||
!_referencesDartHtml(librarySource) &&
|
||||
entry.getValue(IS_LAUNCHABLE);
|
||||
}
|
||||
|
||||
@override
|
||||
|
|
|
@ -1441,6 +1441,11 @@ main() {}''');
|
|||
expect(context.isClientLibrary(source), isFalse);
|
||||
}
|
||||
|
||||
void test_isClientLibrary_unknown() {
|
||||
Source source = newSource("/test.dart");
|
||||
expect(context.isClientLibrary(source), isFalse);
|
||||
}
|
||||
|
||||
void test_isServerLibrary_dart() {
|
||||
Source source = addSource(
|
||||
"/test.dart",
|
||||
|
@ -1460,6 +1465,11 @@ main() {}''');
|
|||
expect(context.isServerLibrary(source), isFalse);
|
||||
}
|
||||
|
||||
void test_isServerLibrary_unknown() {
|
||||
Source source = newSource("/test.dart");
|
||||
expect(context.isServerLibrary(source), isFalse);
|
||||
}
|
||||
|
||||
void test_parseCompilationUnit_errors() {
|
||||
Source source = addSource("/lib.dart", "library {");
|
||||
CompilationUnit compilationUnit = context.parseCompilationUnit(source);
|
||||
|
|
Loading…
Reference in a new issue