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 works around broken FunctionTypeImpl.== in Analyzer. Also
makes DDK's type naming heuristic more consistent with DDC.
Change-Id: I09527fad681c3fdc6c66654e572e9b03c57491bd
Reviewed-on: https://dart-review.googlesource.com/37120
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Jenny Messerly <jmesserly@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>
* 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 CL creates the initial DDC-specific CFE entry point.
It is currently mostly a matter of copying the DDC code for running the
front-end into the front-end, although it also applies a workaround for
making batch-mode faster.
Local timings of running
tools/test.py -mrelease -cdartdevk -rnone --strong --checked language_2
before and after change:
* Before: [05:49 | 100% | + 5136 | - 0]
* After: [00:20 | 100% | + 5136 | - 0]
Change-Id: I799b54b406970c4aa8653b71aaffa2ba476ee9d9
Reviewed-on: https://dart-review.googlesource.com/24921
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
It's added as a new compiler, so pass "-c dartdevk" to use it.
It doesn't support any test packages yet, so tests that, say, import
package expect won't compile. I'll work on that next, but it will
require adding some stuff to the build scripts to build .dill files for
those packages.
This does get test.dart invoking the compiler, running the resulting
test, and correctly reporting the result:
- A test that doesn't throw an exception and stays within the bounds of
what is currently implemented in dartdevk passes.
- A test that compiles correctly but fails at runtime fails with a
RuntimeError.
- A test that contains a compile error fails with a non-zero exit code
and is reported as a CompileTimeError.
Change-Id: Icacbf1ff54dfe7aa4d245382d3b0aeb375cf105b
Reviewed-on: https://dart-review.googlesource.com/15420
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
This ports a fairly large part of DDC's Analyzer-based code generator,
however most nodes are not supported yet.
The goal is to preserve all functionality of code that was ported,
except for deprecated features (e.g. mirrors, fuzzy arrows, libraryRoot).
Change-Id: I3b10d5773c7c10a740fa336720243b03c6b82529
Reviewed-on: https://dart-review.googlesource.com/10705
Reviewed-by: Vijay Menon <vsm@google.com>
Highlights
* compile one module at a time
* use summaries to speed up compiles
* use command runner so we can add more commands later
* some long needed renames and file organization
* various other technical debt has been addressed
Lowlights
* lost node.js runner/tests (node output format still supported)
* possibly lost some closure support/workarounds (format still supported)
* needs more end-to-end tests of the new system
R=vsm@google.com
Review URL: https://codereview.chromium.org/1879373004 .
This change removes functionality that is not part of the core Dart Dev
Compiler, in particular those features that were not designed for
incremental/modular compilation.
For a while, the primary way to use DDC will be as a compiler invoked by
a build system, e.g. make or bazel or some node.js based-build system.
We'd love to see the user functionality provided by these return.
In particular, a well designed server+watcher system would be a huge
boost to productivity!
I'll see about moving over HTML reporting to Analyzer CLI. It has a lovely UI.
Thanks to everyone who contributed these features.
The following features were removed:
* DDC transformer. Transformers require whole world, in memory files.
* DDC server. The server has its own mini-build system.
* Various kinds of reporting. These should be moved to Analyzer CLI.
Note: batch compiler and the node runner are left for now.
R=vsm@google.com
Review URL: https://codereview.chromium.org/1788973002 .
function f(a, opts) {
let b = opts && 'b' in opts ? opts.b : null;
let c = opts && 'c' in opts ? opts.c : c_default;
...
After:
function f(a, {b = null, c = c_default} = {}) {
...
Note:
- Still reverting to old code when any parameter clashes with reserved JS names (see discussion in https://github.com/dart-lang/dev_compiler/issues/392)
- When a parameter clashes with a Object.prototype property, using a clean default opts value (Object.create(null)).
- Passing opts through in aliased constructors, both for speed/concision and correctness (since default param value semantic is weird there)
BUG=
R=jmesserly@google.com
Review URL: https://codereview.chromium.org/1484263002 .
this avoids reloading file contents many times during a compile. `.contents.data` == bad!
also fixes#73, using Analyzer's LineInfo instead of FileSpan to avoid finding line breaks over and over
I did some manual testing on sunflower as well as diffing SDK messages before and after
The one baseline change (23 -> 22) seems more accurate than it was before.
R=vsm@google.com
Review URL: https://codereview.chromium.org/1141013002
Now the HTML can include a hash in the URL for cachable resources, and the serve knows how to include cache-control headers.
In the process of doing so, I had to change a couple things that made it possible to fix#92 as well (producing different output in the command-line than in server mode).
R=vsm@google.com
Review URL: https://codereview.chromium.org/993213003
This fixes the compiler so that all error messages in dependency_graph are reported via the reporter and unifies how errors are constructed in other places as well. With all errors reported together, we use a widget (adapted from polymer) to display the error messages as part of the app in server mode.
R=vsm@google.com
Review URL: https://codereview.chromium.org/988483006