Redesign LibraryPart

Before, the part-URI was serialized as a file-URI and conflated with
source location information. The part-URI is the URI in the following
declaration in a Dart source file:

   part "URI";

This is different from what we normally call a file-URI. A file URI
is used to point to the source location of the part declaration, not
the URI in the part declaration.

Furthermore, the field was serialized using writeUriReference which
only works for URIs that are in the uriToSource map on a Component.
Although this might seem like a safe optimization, it doesn't work
if the uriToSource map is omitted or if a part declaration refers to
a missing file.

Finally, due to the confusing use of fileUri, LibraryPart was
mistakenly implementing FileUriNode and annotations were stripped
of source locations if the source for the part were omitted from
uriToSource.

The partUri field is now an unresolved string that can be resolved
against either the parent library's import- or file-URI to obtain
either version as needed.

Change-Id: I255cb4eeaf89928292ab32a2f6be9ead6cc8cee1
Reviewed-on: https://dart-review.googlesource.com/49500
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
10 files changed
tree: 868b5b1716e73c36fa1e44b8e2772ff8ee6fcbfe
  1. build/
  2. client/
  3. docs/
  4. pkg/
  5. runtime/
  6. samples/
  7. samples-dev/
  8. sdk/
  9. tests/
  10. third_party/
  11. tools/
  12. utils/
  13. .clang-format
  14. .gitattributes
  15. .gitignore
  16. .gn
  17. .mailmap
  18. .packages
  19. AUTHORS
  20. BUILD.gn
  21. CHANGELOG.md
  22. codereview.settings
  23. dartdoc_options.yaml
  24. DEPS
  25. LICENSE
  26. PATENTS
  27. PRESUBMIT.py
  28. README.dart-sdk
  29. README.md
  30. WATCHLISTS
README.md

Dart

Dart is an open-source, scalable programming language, with robust libraries and runtimes, for building web, server, and mobile apps.

Using Dart

Visit the dartlang.org to learn more about the language, tools, getting started, and more.

Browse pub.dartlang.org for more packages and libraries contributed by the community and the Dart team.

Building Dart

If you want to build Dart yourself, here is a guide to getting the source, preparing your machine to build the SDK, and building.

There are more documents on our wiki.

Contributing to Dart

The easiest way to contribute to Dart is to file issues.

You can also contribute patches, as described in Contributing.

License & patents

See LICENSE and PATENTS.