* Add special handling for String concatenations so the first string
gets mapped correctly and work better in sound null safety.
* Update variable assignments to more consistently point to helpful
locations, specifically when lowered from a prefix increment like
`++x`.
* Run the sourcemap and stacktrace test suites with sound null safety.
Previously these suites were running with unsound null safety so more
operations were wrapped in function calls to check for null. Those calls
allowed for mode step or break points that hid some of the issues
addressed in this change.
Issue: https://github.com/dart-lang/sdk/issues/55692
Change-Id: Ibd887c8da64e72ab84c0698dd49b845abfaedbb8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366025
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
* Delete unused stuff
* rename 'path' to 'root'
* accept 'includeEndsWith' as a plain text string so we often can avoid
using regexp
* accept 'subRoots' to filter to directories faster and more precisly
than when using regexps in 'pattern'
* make 'list' async instead of async* (no more yield stuff which we
promptly turn into a list when actually using it)
Note that some changes in testing.json is not 100% semantic-preserving,
e.g. the "parser_all" suite previously had a pattern "/tests/.*\\.dart$"
which was probably meant to include all dart files in the "tests" folder
in the root, but in fact included all dart files in a "tests" folder
anywhere. The updated version does not.
Change-Id: Idd014274f86bf6214dee0753a7738ec80bc6a49e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/358442
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
- Updates test infra to use the assets built by the new "ddc" build
targets.
- The old "dartdevc" targets are still present to avoid breaking
golem when this change lands.
- Old targets are still used when packaging assets for the SDK.
- Golem and the SDK packaging will be updated in following changes.
Change-Id: I1926e0c86833c812f5ed8355d7cd4df8740d79ee
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/315224
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
- Remove all refrences to "ddk" vs "ddc".
- Update throw_in_instance_method to reflect the current sourcemappings
and start running the test again.
Change-Id: Iff82f971e676346b3495a327d2d86cabd73cea03
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279473
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
The length limit for array.init has been bumped to 10,000 elements.
This gives dart2wasm more breathing room to create large constant lists,
maps and sets, until a more general mechanism for large constant arrays
in WasmGC has been decided and implemented.
Change-Id: I267ed7919bed4509481f37d453f2335dc51bb37c
Cq-Include-Trybots: luci.dart.try:dart2wasm-linux-x64-d8-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/245373
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
strict-casts is mostly a drop-in replacement for the deprecated
`implicit-casts: false` option. One big difference, seen in this CL, is that
strict-casts will report a non-Iterable (or non-Stream) in a for-each loop.
Change-Id: Ibc463ae9c870b6a795483c5dea0d2b856e7fd883
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221546
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Most of these arguments are flowing through to a `--packages` argument
which allows passing the `package_config.json` file. In the long term we
should remove the `.packages` file entirely.
TEST=None, the change should have no visible impact.
Change-Id: I60a8b175d5e217a85588bbcb91cc5095514066b4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/211503
Auto-Submit: Nate Bosch <nbosch@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Adding explicit source maps to the operator created a breakable location
when viewing source-mapped dart code in chrome devtools. There isn't a
breakable point in the javascript for a `!` operator so trying to enable
the breakpoint visible in the dart code would trigger some "other
breakpoint".
Recent changes in the V8 debugger have changed which "other breakpoint"
would be triggered.
https://chromium.googlesource.com/v8/v8/+/16b0767adc54de6e0154a0a8226e01efecfdbfbb
This causes our tests to fail and makes the user
interaction a little confusing. Removing the extra source map here seems
to be the most reasonable solution because it prevents a possible
breakpoint from appearing where there isn't a breakable location.
Now, the ! operator doesn't introduce any new source mapping it simply
continues the previous mapping.
Change-Id: I5903bfeaf1bcb2e2a3ce883433153575aa1fd05a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/204742
Reviewed-by: Mark Zhou <markzipan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
- Fixes calls that pass `when` or `message` arguments
- Updates location information on the expression statement versions to
point to the beginning of the `debugger()` call instead of the `;` at
the end of the line.
Change-Id: I56e6d3358a4a4f0f04b4087d062c513fa6729bd3
Issue: https://github.com/dart-lang/sdk/issues/45544
Change-Id: I31838b5877d139554e3aa39c9833fd83ae729a0e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195053
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
- Fix violations
- Ignore lint in js_ast directory. Still holding onto hope that we will
merge this with dart2js version and move out of the ddc package.
- Import all lints from pedantic 1.9.0
Change-Id: I834b4b197dcf0b6924417cdd337cda9a1b6249d5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/183043
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
D8 breakpoints used in sourcemap testing should only be set for
test files and not, accidentally, in sdk source files. This
was hit in a dart2js step debugging test where, after unforking,
the line number in the test file accidentally matched those of
print.dart from the sdk.
Change-Id: I6a9c6f5bfd28b8821e9cee9b10cc6c67e4fc689b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146781
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
In most cases I provided the type that appeared in the return
statements. For a few test files I explicitly typed the return types as
dynamic because it caused diffs in the expected break point locations
when adding more explicit types and it wasn't totally clear what the
new locations should be.
Change-Id: Ifdd80edcccc5fc4a2083ecdbb0e5fbf1c4453e01
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133339
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
The compile_platform template assumes that the output will be in the root-out-dir, and because of that the generated .deps file contains relative paths that only work if the output is in that folder.
It would be nice to fix compile_platform to be more flexible about this, but for now moving the output up fixes the issue that modifications in the sdk were not triggering a rebuild.
Change-Id: Ifc1e7adb23d6911a9f71c341b7968e0a9b1d4973
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126122
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Splits strong_test into 4 shards. This test took 4+ minutes locally with
the fast_strong_test and analyze_test ticking in at ~1:45. This change
makes local testing of frontend unittests take 2 instead of 4 minutes in
total.
Change-Id: Id6015de86d547b209a699b1e5196b3edad1e6977
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114501
Reviewed-by: Jens Johansen <jensj@google.com>
Note: Changes in this CL will require some google3 changes (mostly in code related to test entrypoints).
We encountered an issue whereby cross-module programs importing files
with the same name (but separate identities/locations) were being
overridden throughout all of DDK's module builders. For example, a
module importing "x.dart" and "y/x.dart" would export {x: x, x: x$} -
the latter renamed module shadowing the first. DDC handles this by
prepending a formatted module-root-relative identifier string, so
"y/x.dart" becomes something like y__x, and the export becomes {x: x,
y__x: y__x}. However, this results in some code bloat, especially as
paths become deeply nested. More importantly, the $-renaming scheme is
not consistent across modules. Were we to export x$ instead of x, how
would the importing library know whether x or x$ referred to "y/x.dart"?
To have the best of both worlds, we're introducing the concept of a
module alias that exists at the boundary of module imports and exports.
We use this module-root-relative alias to differentiate modules with the
same name but use the shorter $-renaming scheme throughout the generated
code. Relevant points:
1) jsLibraryAlias has been introduced alongside jsLibraryName.
jsLibraryName no longer must be unique - that property having been
transferred to the alias. DDK no longer just outputs pathSegments.last,
instead adopting DDC's scheme of "creating" a special alias from the
module root. jsLibraryName's temporary IDs are renamed using the
existing DDK scheme.
2) Libraries are now associated with NameSpecifiers. The name and asName
fields represent jsName and jsAlias, respectively, for exports
(vice-versa for imports).
3) The test frameworks have been taking advantage of DDK's previous
naming scheme (throwing way the module root, keeping just the name). A
common pattern is to expect DDK's output symbol to be "someexport", then
forcing DDC's output (normally "some__path__someexport") to resemble
that with the deprecated "library-root" flag set to the path of the
output JS file. We resolve this by updating the scaffolding code to look
for the module-root-relative (long) name, which requires a bunch of
path-to-identifier subsitution logic. The "absoluteRoot" bool in the
sourcemap test runner is a way to reenable this DDC-specific deprecated
behavior. The test runner now requires this alias in the html generator.
Fixes https://github.com/dart-lang/sdk/issues/37473
Change-Id: Iaaa82f3350d424af195967b55c87cb32b30a3d85
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108942
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
This makes it an actual Pub package like most other code inside the SDK
repo. The main goal is to make it easier to write tests for the test
runner itself.
This change:
- Moves all of the code from tools/testing/dart/ over to
pkg/test_runner. Most of it ends up under test_runner/lib/src.
- Move tools/testing/dart/main.dart to
pkg/test_runner/bin/test_runner.dart.
- Move standalone_2/io/test_runner_test.dart to
pkg/test_runner/test/test_runner_test.dart. I don't think it currently
works, but it wasn't being run in its old location either.
- Add test_runner to the analysis-server bot. This ensures the
test_runner package is static error clean.
- Remove standalone_2/io/test_runner_analyze_test.dart which used to
attempt to do the above and is no longer needed.
- Update test.py to look for the test runner at its new location.
- Add test_runner to the repo .packages file and remove the weird
test_dart pseudo-package. (I think this fixes #35279.)
- Remove status file entries for the removed standalone_2 tests.
There are no code changes to the test runner itself aside from fixing
up import paths.
Change-Id: I3d05d50d222b291848fa5a30de2846e803bc81e6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105821
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
Explicit casts make it easier to confidently navigate the code base and
apply refactorings which tighten types. This change exposes a number of
places where types can be tightened, but only the most trivial were
applied. For most places I added the explicit cast that would have
happened anyway and so behavior shouldn't be changing.
- Add the configuration which disallows implicit casts in the analyzer.
- Add explicit casts in almost all instances.
- Where the implicit cast was due to a local variable type on the left,
change it to a `var` so the type is not repeated.
- In a few places add argument types where they were already applied on
the parent type, and the subclass was unnecessarily loosening argument
types to dynamic.
- In a few places where a method was defined with an implicit dynamic
return but had an obvious and consistent return type, annotate the
method instead of casting after calls to that method.
Change-Id: I90e11b1cc08ce69967ea5705b507d5758a8f668f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103381
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Working towards turning on all lints from package:pedantic. This change includes
the lints that needed cleanup and don't change any behavior.
Applied cleanup:
* Don't explicitly initialize variables to null.
* DO use curly braces for all flow control structures.
* Use `.isEmpty` instead of `.length == 0`.
* Use `.isNotEmpty` instead of `.length > 0` or `! .isEmpty`.
* Use `=` to separate a named parameter from its default value.
The remaining lints from package:pedantic will require cleanup that is less
automatic and will be addressed in later changes.
Change-Id: Ie4c3ba685f8a559209dd14ac037203ecd16252c7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103086
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Previously 36% of overrides were annotated, including inconsistent
annotations within a single class.
- Add annotations on remaining overridden methods.
- Add linter section to `analysis_options.yaml` so that missing
annotations are visible while editing.
Change-Id: Ief1a6d5b8da6f4b630a6cfc72a6ed67db346c081
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103140
Reviewed-by: Vijay Menon <vsm@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>