This uses optional new/const and `=` in named argument defaults.
All changes are automated, except for:
- utils/dartdevc/BUILD.gn: run DDC build scripts with --preview-dart-2
- pkg/dev_compiler/tool/patch_sdk.dart: add a TODO that Analyzer doesn't
supporting implicit const in libraries.dart
- pkg/dev_compiler/tool/input_sdk/libraries.dart: was not formatted due
to the aforementioned Analyzer bug
- tools/bots/test_matrix.json: run DDC sourcemap suite in Dart 2 mode
- pkg/pkg.status: skip pkg/dev_compiler if running in Dart 1 mode
Change-Id: I9b80ccba0c2cc7b66efc662a0b16562e3660aee3
Reviewed-on: https://dart-review.googlesource.com/60402
Commit-Queue: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Currently we test dartdevk against SDK/packages that were compiled with
dartdevc (DDC+Analyzer). This CL migrates to having those files compiled
with DDC+Kernel. dartdevc testing is unchanged.
Most of the fixes are around things like special optimized annotations
used in our SDK code, that were not understood by DDK. Also some inline
JS type annoations were not correct.
Change-Id: Iccf4427e4b9beffd6d97a4be654253d91f6cb89e
Reviewed-on: https://dart-review.googlesource.com/57800
Reviewed-by: Vijay Menon <vsm@google.com>
This no longer fails on a bogus error (setting a stack on a primitive):
main() async => throw "hi";
Doesn't come up in tests as that path (rethrow) is only exercised for unhandled exceptions.
Change-Id: I69bcf8c1c6a0cf8841c626594f95c48114ae5aaa
Reviewed-on: https://dart-review.googlesource.com/48463
Commit-Queue: Vijay Menon <vsm@google.com>
Reviewed-by: Jenny Messerly <jmesserly@google.com>
This disables most runtime features of dart:isolate, similar to dart:io.
For now, this supports `new ReceivePort()` and `ReceivePort.close` as
those are used by async tests to keep the Dart VM alive. Those are
no-ops in DDC. Also removes most of dart:_isolate_helper, except for
the JS API that's used to bootstrap DDC `main()`.
Change-Id: I84eab6cd39d05a70a6afe982e952076ddaaa8c0f
Reviewed-on: https://dart-review.googlesource.com/45754
Commit-Queue: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
There are a few bug fixes here as well. Most notably, `.name.name`
instead of `.name` in DDK's analysis of virtual accessors. DDC/K's
handling of spread arguments in JS interop was also fairly broken
(it was generating a RestParameter instead of Spread). There's
also a lot of cleanup in js_ast as well, to make it a bit more
type safe.
Change-Id: Ia5333179e6dd0a62f20ce64a2b2b8bedf2ed7c49
Reviewed-on: https://dart-review.googlesource.com/44700
Commit-Queue: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
* Ensure that chain paths have a trailing slash.
* Don't use ANSI escapes when terminal doesn't support them.
Both changes combined should change the logged output on build bots from running pkg/dev_compiler/test/sourcemap/sourcemaps_ddk_suite.dart from:
<ESC>[2K[ 00:00 | 0.0% | + 0 | - 0 ]: sourcemaps_ddk//breakpoint_on_class_all_in_one_line.unformatte setup<ESC>[1A
To:
[ 00:00 | 0.0% | + 0 | - 0 ]: sourcemaps_ddk/breakpoint_on_class_all_in_one_line.unformatte setup
Change-Id: I0f79e7cefb4e5bcba3002aa49f624cc0a2f7032c
Reviewed-on: https://dart-review.googlesource.com/43402
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
This change improves DDC/DDK source maps:
- fix Analyzer backend step locations to pass all of the tests
Kernel was passing. Also improves breakpoints and code coverage.
- fix Analyzer backend to mark hover spans where possible, such as
fields, parameters, locals, `this`, properties, methods, etc.
- refactor DDC/DDK backends to emit source locations, rather than
pointers to Analyzer/Kernel tree nodes.
- unify/simplify source_map_printer between Analyzer/Kernel backends.
- source_map_printer understands JS expression nesting, marking the
innermost JS expression offset corresponding to a given Dart offset.
This preserves hover tooltips, even for expressions with implicit
coercions (e.g. `dart.test(x)`)
- source_map_printer understands that JS end-of-function markings need
to be before the closing brace.
- merge _visitAndMarkExpression and _visitExpression to simplify
Analyzer & Kernel backends.
- fix test expectations where the column location was too specific.
- adds a message to the stepping test runner to help future debugging.
- removes optional destructuring support from Analyzer backend. This
was unused/untested and added complexity. Instead we should decide
if/when to fully switch to destructuring, and then do so.
Change-Id: Ic47b4e21447fffc8fb1809b7bf8ffceeeb61b43e
Reviewed-on: https://dart-review.googlesource.com/42028
Reviewed-by: Vijay Menon <vsm@google.com>
Also fixes some issues with field initializers; stepping and hover
tooltips should work reasonably now.
Change-Id: I2d0e9e7e14a52ee8c020902f80f835a913f494f3
Reviewed-on: https://dart-review.googlesource.com/39860
Commit-Queue: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Conceptually this is a port of analyzer/nullable_type_inference.dart.
It contains some refactoring and other improvements, as well as tests.
Change-Id: I448440793f11e2e87583d9d47c0e6a1e54ae21f7
Reviewed-on: https://dart-review.googlesource.com/34308
Commit-Queue: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Previously a separate dart process would be spawned to compile a dart
file to JS.
This CL internalize it instead, giving a massive speedup.
Bug:
Change-Id: Ib0c073b1f99ecc0c0531aa83a8299278d90762c8
Reviewed-on: https://dart-review.googlesource.com/29200
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
When fileUri was added to Constructors a few tests had to be marked as
failing. This CL fixes the issue.
Bug:
Change-Id: I1168fab05a8edfcd17416476b3abbaf9322d88b9
Reviewed-on: https://dart-review.googlesource.com/29580
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
* Fix possibly null-pointer at end of batch mode
* Fix changed fileUri type in source map printer
* Silence a few warnings in tests.
Bug:
Change-Id: Ief1b9b62205a7bc20924a9e5efc06b9c9c34896a
Reviewed-on: https://dart-review.googlesource.com/27945
Reviewed-by: Karl Klose <karlklose@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
This moves the logic previously used in DDC for testing stepping via
sourcemaps to a shared location so both DDC and dart2js can make use
of the same thing.
Bug:
Change-Id: I83a2b1fc4fe5cefe3c8537e50d03c3e41e0490a8
Reviewed-on: https://dart-review.googlesource.com/24110
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
This CL "finishes" the first iteration of adding sourcemaps to the
DDC-kernel pipeline. There will likely still be some work left to do,
but it can be added as it is noticed. Ideally by adding a test first.
This CL adds testing and fixes source maps for
- (Better) handling of async, async* and sync*
- Conditional expressions
- await for
- multi catch (catch on (...) { ... } catch on (...) { ... })
- yield
- variable set
- static set
- == and identical
- string concatenation
- is and as
- throw
- map literals
Bug:
Change-Id: Ia3e5145eff049d9829cb636864ef76f300e09615
Reviewed-on: https://dart-review.googlesource.com/24105
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
When running tools/testing/dart/http_server.dart on should probably
use "--network 127.0.0.1", or it will by default listen to 0.0.0.0
(i.e. everything).
Bug:
Change-Id: I13756c9b84a7760784baf1527d77ba766ab45e76
Reviewed-on: https://dart-review.googlesource.com/24103
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
This CL copied stacktrace test ccases from dart2js and updates them
to DDC (mostly kernel version).
Some tests fail (marked in status file) because of dartbug.com/31451.
Bug:
Change-Id: If89c292eedb162fe7fe2832e909654e4ee083340
Reviewed-on: https://dart-review.googlesource.com/23500
Reviewed-by: Johnni Winther <johnniwinther@google.com>
This CL adds source information to the wrapping code for async and named
parameters. This is done for the source mapping not making Chrome (etc)
point to something completely wrong.
Tests are added too.
Bug:
Change-Id: Ifcd16428e0ca8c273fd6377e93297bbfbb37d773
Reviewed-on: https://dart-review.googlesource.com/23480
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Make the tests output html too so it's easy to fire the test up in
"real Chrome" too and step through it in the browser.
Make the test *NOT* delete the output folder when failing and it's run in
debug mode.
Bug:
Change-Id: I1f004e0a408238dcd9b6a296566c808e31b73ccd
Reviewed-on: https://dart-review.googlesource.com/23261
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
This CL adds a test for stepping into a constructor with initializers.
It additionally changes the stack map in the kernel pipeline to produce
a better result in this case.
Bug:
Change-Id: If0a43b030446c4a7370f386f0f51411d223dda83
Reviewed-on: https://dart-review.googlesource.com/20720
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
This CL adds a test for stepping over - among others - a reassignment of
a variable with a new named constructor.
It additionally improves the situation in DDC via kernel.
Bug:
Change-Id: I1658d433575e6614b1cbbbeb7f1765651b0d34bb
Reviewed-on: https://dart-review.googlesource.com/20667
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Now that some files were factored out into a separate package, delete
the copied file and use the package instead.
Bug:
Change-Id: I3e58ae0213517234b179d6dcfcf251830cb1166a
Reviewed-on: https://dart-review.googlesource.com/22980
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
Update the expected paths for summary, sdk and dill files.
Report errors saying that it cannot find specific files instead of
letting ddc crash with some exit code.
Bug:
Change-Id: I88348dc28ebad8cc4b630b85555be978244c8cd7
Reviewed-on: https://dart-review.googlesource.com/22920
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
This CL adds the bare minimum of source map generation for the kernel
pipeline in DDC.
It additionally introduces a testing framework that compiles dart files
with DDC (with or without kernel), steps through it via D8 and compares
the positions stopped at to the expected stop positions.
Bug:
Change-Id: Ie9e06164d8e51c973b83c46a8472e044876e4317
Reviewed-on: https://dart-review.googlesource.com/20662
Reviewed-by: Vijay Menon <vsm@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>