Commit Graph

885 Commits

Author SHA1 Message Date
Nate Bosch 2bbb2f3c1f Disallow implicit casts
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>
2019-05-22 00:33:39 +00:00
Jacob Richman e2976acd22 Add --track-widget-creation flag to frontend_server.
This is needed to activate the kernel transformer embedded with the kernel package from the flutter engine.

Change-Id: I3253e01723b662eb48b4b3743ac5bcc1b44c7d46
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102920
Reviewed-by: Jake Macdonald <jakemac@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Jacob Richman <jacobr@google.com>
2019-05-20 22:47:28 +00:00
Nicholas Shahan 2fd1021326 [dartdevc] Turn on lints and cleanup violations
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>
2019-05-20 20:20:47 +00:00
Nate Bosch 9adc5be551 Dartfmt all of DDC with the latest
Some changes in indentation for adjacent string literals and a case of
formatting inside string interpolation.

Change-Id: I30eb9b9e891a11a54f89351e0f2d4c0172e69066
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103161
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
2019-05-20 19:14:37 +00:00
Nate Bosch 04e329b6ed Add override annotations across DDC
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>
2019-05-20 17:31:26 +00:00
Nicholas Shahan ca9bbd39d5 [dartdevc] Remove ddc and ddk pre-compiled "legacy" sdk modules
We do not expect any client uses of the precompiled SDK in this module format. The only know use
case builds the SDK manually first.

Add simple tests that files can be compiled with `--modules legacy` option.

Issue: #35988
Change-Id: Ie2c4244e5876bb04f968b0198f5763ff3d29c01c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99921
Reviewed-by: Jenny Messerly <jmesserly@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2019-04-23 21:29:15 +00:00
Vijay Menon 5319d76b5a Run ddc worker tests
Change-Id: I3555fe64bacd03a728d63a035457ca1e3398edb2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98699
Commit-Queue: Vijay Menon <vsm@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2019-04-16 00:38:24 +00:00
Jenny Messerly 627e96c9c1 [dartdevc] simplify microtask scheduling using JS Promise
All of DDC's supported platforms have Promises, so we can use them
instead of MutationObservers (web) and timers (node.js).

See issue #20055 (same issue, but for dart2js).

Change-Id: Id635a4a9fa104a2ab19dd20824d209f682f831f9
Reviewed-on: https://dart-review.googlesource.com/c/91765
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Jenny Messerly <jmesserly@google.com>
2019-02-21 20:13:19 +00:00
Peter von der Ahé 7ac495e02a Prepare DDC for removing TypeEnvironment.hierarchy
Validating the class hierarchy requires subtype tests. Previously,
Fasta has worked around this by computing the hierarchy twice, as
well as visiting the hierarchy several times. In order to improve
performance of modular compilation, we're working on changing this.

To enable creating a TypeEnvironment without a hierarchy, we're
removing the field from the API.

Change-Id: If1aa10598012e53455b92a63ebae12dbae316fc7
Reviewed-on: https://dart-review.googlesource.com/c/88822
Reviewed-by: Jenny Messerly <jmesserly@google.com>
2019-01-10 05:21:24 +00:00
Jenny Messerly 36ab8b18ea [dartdevc] implement set literal and enable-experiments support
Change-Id: Ibc45b1b1792d62a8f176e6c2f2f5c1e3134942f1
Reviewed-on: https://dart-review.googlesource.com/c/88400
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Jenny Messerly <jmesserly@google.com>
2019-01-04 22:08:54 +00:00
Jenny Messerly 3d6acab3e7 [dartdevc] remove unused dartdevk binary, fixes #35483
It's simply an alias for `dartdevc --kernel`, and now that build_runner
is switching to that, there's no reason to keep it around anymore.

Change-Id: I43d30a582314a236bcfa2e3a0b50bb48ddac79f8
Reviewed-on: https://dart-review.googlesource.com/c/88281
Auto-Submit: Jenny Messerly <jmesserly@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
2019-01-04 17:19:52 +00:00
Peter von der Ahé de65d6892a Remove legacyMode from type inference
Change-Id: I78a13470e5707c9d26fe1796ad24ba507d93a9e8
Reviewed-on: https://dart-review.googlesource.com/c/86358
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2018-12-19 17:21:51 +00:00
Jenny Messerly f68ae70e8e [dartdevc] ensure all throws are wrapped in JS Error (#33331)
This improves the default JS display of exceptions/errors from DDC
compiled code. This gives a better "default" experience if JS code
(or a JS engine, like browers/Node.js) ends up catching Dart exceptions.

Change-Id: Ib2dda6eee710f8b536d5ed7223e0101310a137b3
Reviewed-on: https://dart-review.googlesource.com/c/84446
Commit-Queue: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
2018-12-13 22:44:17 +00:00
Brian Wilkerson a745f477dc Remove deprecation warnings from ddc
Change-Id: Ifaf46b6770eeb75844633346e35f8c5d9729e3b9
Reviewed-on: https://dart-review.googlesource.com/c/87020
Reviewed-by: Jenny Messerly <jmesserly@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-12-12 14:23:31 +00:00
Jenny Messerly d3c3341b8a [dartdevc] fix conditional imports in kernel backend
Change-Id: I694b67624dff65099ca8cb8147d2b56a3532cd6c
Reviewed-on: https://dart-review.googlesource.com/c/85880
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Jenny Messerly <jmesserly@google.com>
2018-12-04 18:39:46 +00:00
Peter von der Ahé 9931b77802 Rename strongMode constructor parameter of TypeSchemaEnvironment to legacyMode
Change-Id: I713dcf4a2f614893832fb4d18dcaa23c67ffd9c5
Reviewed-on: https://dart-review.googlesource.com/c/84409
Auto-Submit: Peter von der Ahé <ahe@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2018-11-14 09:59:07 +00:00
Jenny Messerly be815e1a86 [dartdevc] fix #35013, move DDC off Analyzer task model
The new file pkg/dev_compiler/lib/src/analyzer/driver.dart handles
building the linked summary for a build unit, and then is capable of
doing analysis using LibraryAnalyzer.

The algorithm is very similar to analyzer_cli's build mode. The
biggest difference is that `dartdevc` has existing support for
discovering source files from the explicit source list (rather than
requiring every source to be listed on the command line). We don't want
to break that support, so there's a bit of logic to follow imports,
exports, and parts.

After the linked summary is produced, DDC gets the analysis results
(errors and resolved AST) for each library, and compiles it into a JS
module.

Change-Id: I7bf1ce1eca73fd036002e498de5924c488b534dc
Reviewed-on: https://dart-review.googlesource.com/c/82469
Commit-Queue: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
2018-11-06 00:52:24 +00:00
Jenny Messerly c0c3fc4c5f [dartdevc] fix #34596, hot restart can now clear field & cache state
This adds a method to the internal SDK runtime library that can be
called to clear state when a hot restart is desired.

This also refactors some of the logic around ignoring type errors,
as we need to ensure we can clear those caches. Also I noticed a bug
where the result of isSubtypeOf was assumed to be non-null, but this
was not the case. The new structure should make this more clear.

(Note: I think we may be able to remove a lot of the code for ignoring
type errors soon.)

Change-Id: Icf5072ffe21aefd85e9816ffc2fc29f679839bc4
Reviewed-on: https://dart-review.googlesource.com/c/78324
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Jenny Messerly <jmesserly@google.com>
2018-10-18 19:52:32 +00:00
Peter von der Ahé a2aa6c8414 Consolidate DDC dependencies on front_end
We're consolidating all dependencies on package:front_end in one file per tool.

The idea is, if you want to depend on something in the package:front_end, you
modify pkg/front_end/lib/src/api_unstable/ddc.dart and consult with the
front-end team.

These consolidated files will help us when designing a public API in the
future.

Change-Id: I505b8f986e8c2b1d93e158171c1ecc0c4e12b9a6
Reviewed-on: https://dart-review.googlesource.com/c/78220
Reviewed-by: Jens Johansen <jensj@google.com>
2018-10-16 08:02:49 +00:00
Peter von der Ahé bc49637085 Convert package:dev_compiler to use onDiagnostic
Change-Id: I67eaae26c40452dd94c4135e813cfdd89e2fb087
Reviewed-on: https://dart-review.googlesource.com/c/77563
Reviewed-by: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Peter von der Ahé <ahe@google.com>
2018-10-03 06:46:55 +00:00
Jenny Messerly 1a122e3ac0 Deprecate module-root option in dartdevc, part of #32272
Adds an option for specifying the output JS module name if that is
needed (only applies for some module formats).

Also removes repl-compile (it's set via API, not the command line).

Refactors dartdevk options to match dartdevc so we can migrate more
easily. Moves shared code into a shared location and removes copied
code.

Change-Id: I966343ecbbc962f5d0f14ea7e65d78660159f420
Reviewed-on: https://dart-review.googlesource.com/64823
Commit-Queue: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2018-07-26 02:43:48 +00:00
Peter von der Ahé a3bb529eec Update package:testing wrt. void
Change-Id: I7bb99b192410c0fc966cff06bea3a938b1d0351b
Reviewed-on: https://dart-review.googlesource.com/65504
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2018-07-18 10:18:52 +00:00
Jenny Messerly 875abcea39 Remove experimental closure support from dartdevc
Change-Id: Id171cbfd220c4b504f13183ffdcad581c44fb41a
Reviewed-on: https://dart-review.googlesource.com/64826
Commit-Queue: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2018-07-16 19:32:44 +00:00
Jenny Messerly 2420134b23 Remove obsolete tools and tests from package:dev_compiler
Change-Id: I28fcd5832d89a0531961daac8f94a97a8b5ec68c
Reviewed-on: https://dart-review.googlesource.com/64824
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Jenny Messerly <jmesserly@google.com>
2018-07-16 19:28:01 +00:00
Devon Carew 6cc709e192 Avoid using deprecated apis and constants.
Change-Id: I471335e882817711c5d22ccb956dca5e33834679
Reviewed-on: https://dart-review.googlesource.com/64081
Reviewed-by: Jenny Messerly <jmesserly@google.com>
2018-07-10 22:35:58 +00:00
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
Jenny Messerly 976aa4074b Run dartdevk against its own compiled SDK and packages
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>
2018-06-08 19:18:34 +00:00
Jenny Messerly f059df7cc5 unfork DDC package:async_helper
This code was from the old travis/karma test runner setup, it is no
longer used. Also deletes the old browser test runner files.

Change-Id: I7eab3ebdc709cfc9c48d6f230c73035bc512cea9
Reviewed-on: https://dart-review.googlesource.com/57780
Reviewed-by: Vijay Menon <vsm@google.com>
2018-06-06 21:58:01 +00:00
Jenny Messerly 29afbf8f12 Implement constant evaluation for dartdevk
This builds on the VM's support for constants, and brings dartdevk to
parity with dartdevc. Also, constants are computed with arithmetic
operations that match runtime behavior (JS numbers).

Constants are limited in some cases right now: when building outline
kernel files (via pkg/dev_compiler/tool/build_pkgs.dart), constant field
initializers are not preserved, and this fact is not recorded, making
these fields appear to be implicitly null. dartdevk will recognize this
and avoid inlining the constant in these cases.

Change-Id: I5e6d95ccc32799da3bec1667ed16078a1a87d0bd
Reviewed-on: https://dart-review.googlesource.com/53121
Commit-Queue: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
2018-05-15 06:04:18 +00:00
Kevin Millikin 8dbe716085 Remove the unused GenericCovariantInterface bit
None of the back ends are using it and it imposes a cost to have to
compute it and try to preserve it.

Change-Id: I217e1191b535829021fa11f2698cadd8d4baf1c8
Reviewed-on: https://dart-review.googlesource.com/54383
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2018-05-09 15:04:43 +00:00
Dmitry Stefantsov fe3f87f192 [fasta] Reland "Handle annotations on formals and variables"
The original CL: https://dart-review.googlesource.com/c/sdk/+/51840

Bug: http://dartbug.com/28434
Change-Id: I0812ef4223337f5bf72218dfac0f26f76a6b9df1
Reviewed-on: https://dart-review.googlesource.com/52449
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
Reviewed-by: Jenny Messerly <jmesserly@google.com>
2018-05-09 09:53:42 +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
Kevin Moore 9f7a247c33 Remove dangling pubspec.lock from pkg/dev_compiler/test/
Change-Id: I560adb1d3941bb3110c3d03782615c104b734713
Reviewed-on: https://dart-review.googlesource.com/52702
Reviewed-by: Jenny Messerly <jmesserly@google.com>
Commit-Queue: Kevin Moore <kevmoo@google.com>
2018-04-26 00:46:32 +00:00
Dmitry Stefantsov 1f7fa3e1ad Revert "[fasta] Handle annotations on formals and variables"
This reverts commit 0289071afe.

The reverted commit breaks precomp bots.

Change-Id: I3218d5a0779e1f30f4172ede2294be558ded2abd
Reviewed-on: https://dart-review.googlesource.com/52103
Reviewed-by: Jens Johansen <jensj@google.com>
2018-04-20 13:32:59 +00:00
Dmitry Stefantsov 0289071afe [fasta] Handle annotations on formals and variables
Bug: http://dartbug.com/28434
Change-Id: If386d24f95d14a38150c9316caf7a17065583e32
Reviewed-on: https://dart-review.googlesource.com/51840
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Samir Jindel <sjindel@google.com>
Reviewed-by: Jenny Messerly <jmesserly@google.com>
2018-04-20 11:19:39 +00:00
Vijay Menon 163f8b9678 Cleanup async stack recording
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>
2018-04-04 01:03:41 +00:00
Jenny Messerly b07a4bc264 improve deduping of cached types in DDC/K
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>
2018-04-04 00:37:21 +00:00
Jenny Messerly c9e9c1d8e9 Remove dart:isolate runtime support in DDC
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>
2018-03-28 19:42:08 +00:00
Peter von der Ahé 4f2bdff90b Rename Program to Component
Change-Id: I1a3cc03fba9783807fa637a9d42fdbad68ee7686
Reviewed-on: https://dart-review.googlesource.com/31040
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2018-03-15 12:22:23 +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
Peter von der Ahé fc5e9938e6 Tweak output from package:testing
* 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>
2018-02-23 12:50:04 +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
Aske Simon Christensen 194dcf6a9b Report detailed errors when the number or names of arguments do not
match parameters of callee.

Closes https://github.com/dart-lang/sdk/issues/31795

Change-Id: Ic53cc55174a540f387289d4d9cc24ff5c65c547e
Reviewed-on: https://dart-review.googlesource.com/40822
Reviewed-by: Paul Berry <paulberry@google.com>
2018-02-20 16:42:25 +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
Paul Berry 421db9c69c Re-land "Implement proper checking for callability of Function class."
(was reverted in https://dart-review.googlesource.com/c/sdk/+/40980
due to an analyzer bot breakage)

Original commit message:
Implement proper checking for callability of Function class.

There was some old (incorrect) logic for doing this, behind the flag
enableStrictCallChecks.  This flag has been removed, since the new
behavior is now standard in Dart 2.0.

Fixes #31509

Change-Id: Ice5cf38bbc648badf7f2563ff930b69f9a799635
Reviewed-on: https://dart-review.googlesource.com/41120
Reviewed-by: Jonas Termansen <sortie@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-02-14 11:30:23 +00:00
Paul Berry 35aea15097 Revert "Implement proper checking for callability of Function class."
This reverts commit 6837dafcc3.

Reason for revert: Broke analyzer bots.

Original change's description:
> Implement proper checking for callability of Function class.
> 
> There was some old (incorrect) logic for doing this, behind the flag
> enableStrictCallChecks.  This flag has been removed, since the new
> behavior is now standard in Dart 2.0.
> 
> Fixes #31509
> 
> Change-Id: I4a6da34a4b85ea8409f6e0d14c377a586546056a
> Reviewed-on: https://dart-review.googlesource.com/40509
> Commit-Queue: Paul Berry <paulberry@google.com>
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
> Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
> Reviewed-by: Mike Fairhurst <mfairhurst@google.com>

TBR=paulberry@google.com,scheglov@google.com,brianwilkerson@google.com,mfairhurst@google.com

Change-Id: Ib631ad16bc5e937ff914127d1c5330f3fcaff2c9
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/40980
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-02-13 19:56:35 +00:00
Paul Berry 6837dafcc3 Implement proper checking for callability of Function class.
There was some old (incorrect) logic for doing this, behind the flag
enableStrictCallChecks.  This flag has been removed, since the new
behavior is now standard in Dart 2.0.

Fixes #31509

Change-Id: I4a6da34a4b85ea8409f6e0d14c377a586546056a
Reviewed-on: https://dart-review.googlesource.com/40509
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2018-02-13 14:19:08 +00:00
Jenny Messerly 4f5b5566c1 fix #32082, local variable assignment source location
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>
2018-02-08 02:58:39 +00:00
Peter von der Ahé 4d1adf42d3 Deprecate IncrementalClassHierarchy
See https://github.com/dart-lang/sdk/issues/31842

Change-Id: I019909831a91a4e06138dc3a6bf32f766bca1ae6
Reviewed-on: https://dart-review.googlesource.com/34880
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2018-01-17 13:30:17 +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