| Index: pkg/analyzer/lib/src/generated/source_io.dart
|
| diff --git a/pkg/analyzer/lib/src/generated/source_io.dart b/pkg/analyzer/lib/src/generated/source_io.dart
|
| index bde6b54d1f48c7a41cb7edf1982a208ed7235aeb..00682395d4c63c45269ffdbb983d1d522a5ce54f 100644
|
| --- a/pkg/analyzer/lib/src/generated/source_io.dart
|
| +++ b/pkg/analyzer/lib/src/generated/source_io.dart
|
| @@ -111,11 +111,17 @@ class FileBasedSource implements Source {
|
| bool exists() => _contentCache.getContents(this) != null || (_file.exists() && !_file.isDirectory());
|
|
|
| void getContents(Source_ContentReceiver receiver) {
|
| + //
|
| + // First check to see whether our content cache has an override for our contents.
|
| + //
|
| String contents = _contentCache.getContents(this);
|
| if (contents != null) {
|
| receiver.accept2(contents, _contentCache.getModificationStamp(this));
|
| return;
|
| }
|
| + //
|
| + // If not, read the contents from the file using native I/O.
|
| + //
|
| getContentsFromFile(receiver);
|
| }
|
|
|
| @@ -255,11 +261,14 @@ class PackageUriResolver extends UriResolver {
|
| String relPath;
|
| int index = path.indexOf('/');
|
| if (index == -1) {
|
| + // No slash
|
| pkgName = path;
|
| relPath = "";
|
| } else if (index == 0) {
|
| + // Leading slash is invalid
|
| return null;
|
| } else {
|
| + // <pkgName>/<relPath>
|
| pkgName = path.substring(0, index);
|
| relPath = path.substring(index + 1);
|
| }
|
|
|