Tweak dart2js source map rewriting (#2128)

- Remove a TODO referencing a closed issue. The issue was deduped to
  another which was closed without changes. Manual testing in a browser
  shows that the rewriting is still necessary.
- Extract a variable for the source map path as a Uri instead of
  computing it within the loop.
- Directly return URIs which are already `file://`. This would be a
  slight behavior change for the `runInBrowser.dart` synthetic source if
  it was ever put in the source map file with an absolute `file://`
  URI, but with the current (and apparently planned) dart2js output they
  do not have the file scheme. This is not a behavior change for any
  other cases where the source is a `file` URI, since it is no necessary
  to call `resolveUri` with an absolute path, and all `file` URI are
  absolute.
- Refactor for readability - use a list literal, `Map.update`, and a `switch`.

A sample run with a `Stopwatch` shows this reduces the non-IO overhead
by about 75% (out of 165ms in my sample with multiple suites).
1 file changed
tree: 0a85536f7ad927141a442a189939b7437a691e7e
  1. .github/
  2. integration_tests/
  3. pkgs/
  4. tool/
  5. .gitattributes
  6. .gitignore
  7. analysis_options.yaml
  8. CONTRIBUTING.md
  9. mono_repo.yaml
  10. README.md
README.md

Dart CI OpenSSF Scorecard

What's here?

Welcome! package:test is the standard testing library for Dart and Flutter. If you have questions about Dart testing, please see the docs for package:test. package:test_api and package:test_core are implementation details and generally not user-facing.

package:checks is a relatively new library for expressing test expectations. It's a more modern version of package:matcher and features a literate API.

Packages

PackageDescriptionVersion
checksA framework for checking values against expectations and building custom expectations.pub package
testA full featured library for writing and running Dart tests across platforms.pub package
test_apipub package
test_corepub package