Fix newline normalization in _PhysicalFile.readAsStringSync().

Most clients of _PhysicalFile read the file by translating it into a
Source object using createSource() and then reading it using
FileBasedSource.contentsFromFile, which normalizes newlines using
FileBasedSource.fileReadMode.

However, a few clients read the file directly using
_PhysicalFile.readAsStringSync(), which wasn't doing the
normalization.  This CL adds the normalization to that code path.

One such client was the code generation logic for summaries; this
caused code generation to produce different results on Windows, which
led to a test failure.

Fixes #25470.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1584313010 .
1 file changed
tree: 1b01e9c300dde46eb92a93e17f08c34c7a07e1bb
  1. client/
  2. docs/
  3. pkg/
  4. runtime/
  5. samples/
  6. samples-dev/
  7. sdk/
  8. site/
  9. tests/
  10. third_party/
  11. tools/
  12. utils/
  13. .gitattributes
  14. .gitignore
  15. .mailmap
  16. AUTHORS
  17. CHANGELOG.md
  18. codereview.settings
  19. create_sdk.gyp
  20. dart.gyp
  21. DEPS
  22. LICENSE
  23. PATENTS
  24. PRESUBMIT.py
  25. README.dart-sdk
  26. README.md
  27. 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

Learn how to get the source and prepare your machine to build the SDK.

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

See LICENSE.