Commit Graph

14 Commits

Author SHA1 Message Date
Jenny Messerly 1ef4399df0 Run dartfmt --fix for dart2 on pkg/dev_compiler
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>
2018-06-15 00:28:13 +00:00
Vijay Menon 001af89c8e Flip DDC to default to sync-async
See #32868

Change-Id: I757321632c9f383edea398741c67fc7c3e3815e5
Reviewed-on: https://dart-review.googlesource.com/52900
Commit-Queue: Vijay Menon <vsm@google.com>
Reviewed-by: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-04-30 15:04:51 +00:00
Jenny Messerly dab7da78cd fix implicit casts in DDC
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>
2018-03-07 01:26:21 +00:00
Jenny Messerly c9d2d5ba36 fix #32209, hover on cascades in DDC
Also improves hover on instance creation, so the constructor can be
hovered/jumped to.

Change-Id: Ie05c6e8cf4b98b334aba31be80bbe97a56d2079e
Reviewed-on: https://dart-review.googlesource.com/42084
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Jenny Messerly <jmesserly@google.com>
2018-02-21 04:35:44 +00:00
Jenny Messerly 2d851eb444 fix #32083, improve hover and stepping for DDC source maps
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>
2018-02-17 21:25:56 +00:00
Jenny Messerly f17ccdfbea fix #31782, implement not-null analysis for dartdevk
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>
2018-01-12 22:40:50 +00:00
Jens Johansen b2dd8418d9 [DDC-kernel] Fix of various annoyances
* 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>
2017-12-11 08:42:17 +00:00
Jens Johansen ac245f73af [DDC-kernel] Finish stage 1 of adding source maps
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>
2017-11-30 10:28:51 +00:00
Jens Johansen c69cf9312d [DDC-kernel] Add source information to async wrapper and named parameter
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>
2017-11-24 14:05:20 +00:00
Jens Johansen 19a0100a96 [DDC-kernel] Add source mapping to classes
This CL adds (initial) source mapping to classes and adds (some) tests
of wanted behaviour.

Bug:
Change-Id: I07a38930963b9d93e3bae5206b9eceda69643f7d
Reviewed-on: https://dart-review.googlesource.com/23300
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2017-11-24 14:05:20 +00:00
Jens Johansen 28607729fc [DDC-kernel]: Stepping into constructor with initializers
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>
2017-11-24 14:05:20 +00:00
Jens Johansen bf81788671 [DDC-kernel]: Stepping over foo = new Foo.named()
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>
2017-11-23 11:58:26 +00:00
Jens Johansen c41c39d876 [DDC-kernel] Add missing copyright notice to sourcemap testing files
Bug:
Change-Id: Iec24647acc9ad7ee49ed3f4e83bf534d483e94b8
Reviewed-on: https://dart-review.googlesource.com/22981
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2017-11-23 08:49:36 +00:00
Jens Johansen df1d05a7a1 [DDC-kernel] Initial source maps; testing framework for sourcemaps
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>
2017-11-21 10:23:08 +00:00