Commit Graph

2263 Commits

Author SHA1 Message Date
Paul Berry a2e1434603 Breaking changes for analyzer version 0.37
Change-Id: I65a16ab2d2ca05de701c27f08300de85a6316b41
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99880
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-07-02 03:59:49 +00:00
Lorenz Nickel 79e478e50e Fixed some links
**I fixed some links and some other minor flaws.**

I also found the following outdated links, which I didn't fix:

- [This link](https://github.com/dart-lang/pool/tree/zone.strong) in [this file](https://github.com/dart-lang/sdk/blob/master/docs/newsletter/20170728.md) (didn't fix because don't know new location and this is some sort of archive so the link should probably stay the original)
- [This link](https://www.dartlang.org/tools/analyzer) in [this file](https://github.com/dart-lang/sdk/blob/master/pkg/analyzer_cli/lib/src/options.dart) (didn't fix since the link is still working, it just gets redirected and the link is part of the programm, I don't want to break anything by changing it, all other links are in comments)
- [This link](https://github.com/domokit/mojo/issues/728) in [this file](https://github.com/dart-lang/sdk/blob/master/build/config/compiler/BUILD.gn) (didn't fix since probably has no new location and is part of TODO, which I don't want to change)

While doing all this I also noticed that [these tests](https://github.com/dart-lang/sdk/tree/master/tests/compiler/dart2js_extra) contain a lot of other inconsistencies in their comments and the location of the import-statements (I only fixed one which was not link-related), could be target of another PR.

Closes #36927
https://github.com/dart-lang/sdk/pull/36927

GitOrigin-RevId: 71d05d0b52d8ec5b92d077a070e066d1fdd4bbfa
Change-Id: Ide4b2424fccad8ae2e06c788efd4443dc0de997b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102222
Reviewed-by: Michael Thomsen <mit@google.com>
Commit-Queue: Michael Thomsen <mit@google.com>
2019-07-01 16:21:41 +00:00
Jacob MacDonald 279c1da42d Use absolute paths as canonical paths for inputs digest maps
Change-Id: I9a6c5efe22d4ef1f46393e2983084fe0b8a4652b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107682
Reviewed-by: David Morgan <davidmorgan@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
2019-07-01 16:02:14 +00:00
danrubel 8d705089ba remove retired experimental flags from kernel
Change-Id: Id0f5e64ad7431e42a10c09fdaf1fae70b73a6d68
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104900
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-06-27 18:19:55 +00:00
Nate Bosch 032576b323 Make local helpers and fields private
Reduce the surface area of this library to only the fields and methods
which are used from somewhere else.

Cleanup:
- Drop `get` from method names that were changing anyway.
- Remove the `emitMetadata` getter since it's nearly as short to read it
  from the options field.
Change-Id: I8b28f5bbdde57c045c76b11f35c0b224adac89ae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107462
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Auto-Submit: Nate Bosch <nbosch@google.com>
2019-06-26 22:45:08 +00:00
Paul Berry a80b3279a9 Add more specific deprecation notices to package:analyzer/analyzer.dart.
Also fix dev_compiler and tools/patch_sdk.dart to stop using
deprecated functions from package:analyzer/analyzer.dart.

Change-Id: I623e2e5e9cfaed6f52b6126b4eb65d8b47dd3afb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107140
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
2019-06-25 13:10:57 +00:00
Jacob MacDonald 0fa8986a07 Use worker input digests for ddk instead of reading the full file bytes.
Also actually compare the SDK summary digest instead of assuming it doesn't change.

Most of this logic is mirroring logic in the bazel_worker.dart file that kernel uses, which eventually we should unify.

Change-Id: If33af0d8de0b0a6a17081dcd852dd036c4b34a82
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107184
Auto-Submit: Jake Macdonald <jakemac@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
2019-06-24 21:17:20 +00:00
Nicholas Shahan ffb044e4f0 [dartdevc] Apply all lints from pkg:pedantic
Ignore slash_for_doc_comments in lib/src/js_ast to avoid additional diffs when
potentially un-forking in the future.

Fixes: #37218
Change-Id: If5c5bacf2d77fbae432217ba6031a6a8fa5dfcd8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106580
Commit-Queue: Nate Bosch <nbosch@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2019-06-21 22:13:59 +00:00
Robert Nystrom ee8d2322d4 Remove support for ignoring cast failures in DDC.
Change-Id: I63aac10df5e26155f394623308a03c1977eba1e3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106400
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
2019-06-19 21:50:21 +00:00
Paul Berry 01dcec46e7 Refine type of ClassTypeAlias.declaredElement.
This is an API change, but it's non-breaking, because
ClassTypeAlias.declaredElement has always returned a ClassElement; its
return type simply didn't reflect that fact.

Change-Id: I45bcfe1b371953e86f9690b7727be89a835841a3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106681
Auto-Submit: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-06-19 20:23:50 +00:00
Nicholas Shahan 2073a822bd [dartdevc] Add top level function names to NSM error messages
These are now represented as named functions. This will also help the
debug tools give more information.

Tested with three applications and adding the names caused a code size increases
of less than 1%.

|Total App JS size | Increase |
|------------------|----------|
|  24.7 MB         |   0.06%  |
|  242  MB         |   0.14%  |
|  327  MB         |   0.19%  |

Fixes: #37118
Change-Id: I89a259215ceb8b9e559a190dbd521c923d4c55c2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105546
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
2019-06-17 20:58:31 +00:00
Robert Nystrom 99e8a9fba5 Move the test runner (i.e. "test.dart"/"test.py") to pkg/.
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>
2019-06-14 23:35:10 +00:00
Nicholas Shahan 177f425012 [dartdevc] Fix violations of library_prefix lint
Rename the library prefix used in imports from `JS` to `js_ast`. Create more of
a distinction between:
* `JS` the library.  Now named `js_ast`.
* `js` the const instance of a JSBuilder.
* `JS` the helper to inline javascript in the SDK patches
  and runtime libraries.

Ignore the lint in the js_ast directory to avoid additional diffs for the
eventual un-forking of the package.

Cleanup a few unused imports.

Issue #37218

Change-Id: I039c1048876d9d9ad424fbec3ad555d300845a3d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106160
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2019-06-14 22:48:40 +00:00
Mike Fairhurst 2eebc1024c Refactor non-bool expression checks
Change-Id: I4da7abe3293c4dbf7218f3a276cf9418b3d14f19
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106000
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-06-14 21:50:30 +00:00
Nicholas Shahan 611ed823f0 [dartdevc] Add packages arg for creating the DDC SDK from kernel
Copied from a change by keertip@ from internal repo.
Original change ID: 253076358

Change-Id: I997ffe7c4fa0588689a2562b7b1dcd5c01837919
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106002
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2019-06-13 21:58:16 +00:00
Mark Zhou 60c04b8f44 [dartdevc] DDK now outputs relative paths in source maps
Bug: https://buganizer.corp.google.com/issues/133784498
Change-Id: Ifbaae661ac401d0a935a100fbbb7fa2e42325abc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105703
Commit-Queue: Mark Zhou <markzipan@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
2019-06-13 21:16:45 +00:00
Nicholas Shahan 1e92103181 [dartdevc] Fix violations of avoid_relative_lib_imports lint
Issue: #37218
Change-Id: Id248e378d6fbe832952b8e61102da7f68536f81b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105861
Commit-Queue: Nate Bosch <nbosch@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2019-06-13 17:30:17 +00:00
Nicholas Shahan aaf7d2023f [dartdevc] Fix violations of unawaited_futures lint
Issue: #37218
Change-Id: I736afd1a339be0573126ed2184b9a04e0ab73f8d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105781
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2019-06-12 23:27:17 +00:00
Konstantin Shcheglov 0e4e14a288 Build summary2 in DDC.
New summary2 will unblock fixing long standing inference issues in
Analyzer.

We build it in addition to summary1, and will switch clients to summary2
incrementally. With this CL DDC will build summary2, but will not
consume it yet for analyzing code. This will be done in a separate CL.

This change was also tested in the internal repo, and does not cause
related build failures.

Change-Id: Ic2c635e45b514a2610e938129fa7527fd8d070b4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105261
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-06-12 16:09:24 +00:00
Terry Lucas 92dabc8491 Cache the WidgetCreatorTracker.
This fixes the problem when the flutter bots run multiple tests from the flutter tool e.g.,
  flutter test first_widget_test.dart second_widget_test.dart

The first test causes the set of libraries, particularly Flutter's framework library, to be passed
to the transformer. The transformer needs the 'Widget' class located in Flutter's framework
library. The transformer on the first test works.  Each subsequent test only the libraries not in
the prior test are passed, without the framework library, the transformer is unable to find the
'Widget' class and the widget transformer fails to run.

This fix allows the use of a nice speedup to hot-reloading Flutter applications when
--track-widget-creation is enabled and it allows us to enable --track-widget-creation by default,
for command line Flutter users.

This fixes issue https://github.com/dart-lang/sdk/issues/36640

R=jacobr@google.com,askesc@google.com

Change-Id: I9a9c9dc69995122d0f7a7a3e1dfaebf57abb4afb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105661
Commit-Queue: Terry Lucas <terry@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Jacob Richman <jacobr@google.com>
2019-06-12 11:07:36 +00:00
Nicholas Shahan 8aa4414f1b [dartdevc] Ignore violation of empty_catches lint
* Only appears in a sourcemap test.

Issue: #37218
Change-Id: I0bb24db28c2d0041629de12c47273dfdc2b8b2f4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105547
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2019-06-11 16:51:13 +00:00
Nate Bosch aa246f6588 Add return types on all main declarations
Reduces the noise when disallowing implicit dynamic.

Change-Id: I98b03cb675ecd4b9e7f4135efa274fb57eb87832
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104164
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
2019-06-11 00:19:00 +00:00
Sigmund Cherem fddecf659c Do not hide problems in kernel_sdk.dart
This addresses the most concerning problem in #37117

Change-Id: I38feb310023b066922a8049c5026a49572c3e399
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105461
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2019-06-07 22:51:49 +00:00
Nicholas Shahan 80fb7891eb Cleanup violation of no_duplicate_case_values lint
Technically 'let' is an invalid identifier in ES6 strict mode.
http://www.ecma-international.org/ecma-262/6.0/#sec-identifiers-static-semantics-early-errors

We are never passing `strictMode = false` so either way it always returns true.

Change-Id: I7891202d76dce621ee314dc583c6a44f916ab5b9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104382
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2019-06-07 21:59:06 +00:00
Sigmund Cherem efaec6449d Add --use-sdk support for dart2js and ddk modular tests
This allows the test runners to use snapshots instead of using the compilers
directly from source.

Change-Id: I70664a740bed8de647adb658bd521cd574aa685e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104385
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-06-07 21:54:56 +00:00
Sigmund Cherem f6d67a549b Turn ddc and dart2js modular tests into suites and share their test cases
For this to work properly, we first need the test infrastructure to have support
for the `--output-directory` flag (see base CL)

Change-Id: I75f788d19ad3b4e9523830250c4a1c9de8418cda
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104400
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-06-07 21:54:56 +00:00
Jacob MacDonald b7aa075ca2 add a --libraries-file option to ddk
Change-Id: If0698f5b3f3736fe597fbfe0a1d13cc4205c9575
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105403
Auto-Submit: Jake Macdonald <jakemac@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
2019-06-07 18:03:15 +00:00
Jacob MacDonald 8a57c1d463 handle range errors when getting locations
Bug: https://github.com/dart-lang/sdk/issues/37018
Change-Id: I7a9e0d4186abe37133ef29c719a81461e26cc54f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105340
Auto-Submit: Jake Macdonald <jakemac@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
2019-06-07 14:37:20 +00:00
Vijay Menon 612a3f8978 [dartdevc] enable sdk compilation from dartdevc
Kernel mode only

Build with:
> dart bin/dartdevc.dart -k --compile-sdk dart:core --modules amd -o dart_sdk.js

For now, this doesn't support building only parts of the SDK - dart:core brings everything in.

Change-Id: I23cda3064408778dc93c9b3d4be757f1e99bae0e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104811
Reviewed-by: Jake Macdonald <jakemac@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2019-06-06 21:59:21 +00:00
Vijay Menon 3b5a187726 [dartdevc] move ddc internal libraries under sdk
Note, this has the effect of including all DDC Dart sources with the
shipped SDK: we ship everything under sdk/lib.

This should enable https://github.com/dart-lang/build/issues/2262

Change-Id: If66bc7c620034e7f2acf7d2c3e9524a408417681
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104383
Commit-Queue: Vijay Menon <vsm@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-06-04 13:47:29 +00:00
Nate Bosch 0241e40c15 Track Library URI for classes
Closes #36771

- Add getLibraryUri and setLibraryUri runtime utility.
- When emitting classes add a statement to set the library URI.

Change-Id: I8974c7fdd4d9986f27a35f116d9881af043c0c9c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104641
Reviewed-by: Jake Macdonald <jakemac@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
2019-06-03 21:47:17 +00:00
Vijay Menon 69063ab552 [dartdevc] automatically find d8 in ddb
Also remove stale files

Change-Id: Ie3004a3c7f30148459caa1a4b08d909c08484eca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104420
Commit-Queue: Vijay Menon <vsm@google.com>
Auto-Submit: Vijay Menon <vsm@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2019-06-03 20:02:46 +00:00
Sigmund Cherem 1045ef1ceb Use generic test runner to log data using the test infrastructure jsonl format
Mostly this is adding an abstraction so we can produce the jsonl files that will
allow us to track the status of each test individually.

On a separate CL I'll be moving the tests out of the current unit tests into
their own step in the test matrix.

Change-Id: Id4537db1458949370195124164b120b49a7a526c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104384
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-06-03 19:16:49 +00:00
Nicholas Shahan c4a1ca903f [dartdevc] Cleanup violations of unrelated_type_equality_checks lint
These violations look like actual bugs and were not simply mechanical fixes.

Change-Id: I69ae67751e48829fc4733dcb327ba0aa52602c91
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104063
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2019-05-30 21:35:25 +00:00
Nate Bosch 2958e80671 Refactor to conditional and spread elements
Change some of the straightforward collections to use spreads, for
elements, and conditional elements. Many of the patterns in this file
can't be translated because they are more complex - keep the simple ones
with a declarative structure so that it is more clear when there are
extra computations or side effects that are meaningful.

Change-Id: I135b10641f61fc43ebbc4bbd7196c315339c3ee8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104103
Commit-Queue: Nate Bosch <nbosch@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
2019-05-30 01:12:12 +00:00
Nate Bosch 475d68527c Add types on overridden method signatures
We were inconsistent about using return and argument types with
overridden methods. It is technically safe to omit them since they'll be
inferred from the super class - but it's more explicit and readable to
repeat them here. We were already using types on some of the overrides -
add them to the remainder.

Change-Id: Id8529e40a80c8ff3d5feb231a37a12d3d6487b4d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104160
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
2019-05-30 00:18:09 +00:00
Sigmund Cherem d99d83ea09 Add ddc modular test suite and single test
The test is failing, for now I plan to just land the test in its failing test and change the status once it starts passing.

Change-Id: I305c32cc7a163e280bdb766f29835264c331c9ac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103680
Reviewed-by: Vijay Menon <vsm@google.com>
2019-05-29 22:24:21 +00:00
Vijay Menon dd5530a73e [dartdevc] make ImmutableSet private
Patch files should not add public members to the underlying library.

Siggi was hitting this when wiring up modular testing for DDC:
https://dart-review.googlesource.com/c/sdk/+/103680/3/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/operations.dart#544

The ddk builder appears to have be swallowing this error - not yet sure why.

Change-Id: I86098b25a344b2bb8b69fe3dc386d01f6f7cb309
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103740
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2019-05-29 20:04:24 +00:00
Nicholas Shahan 694699c6e4 [dartdevc] Improve NSM errors when making dynamic calls
Add specific error text for the dynamic call failure cases:
* Calling null.
* Calling an object instance with a null `call()` method.
* Passing too few or too many arguments.
* Passing incorrect named arguments.
* Passing too few or too many type arguments.
* Passing type arguments to a non-generic method.

This does not address the issue of a missing name. The errors still just
reference 'call'. Tagging a name could be added in a future change.

Issue: #36165
Change-Id: I21592ef506908559da0bfe9aac5ed5bae7fcb84e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103645
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2019-05-29 16:57:30 +00:00
Vijay Menon 47e63b0eee [dartdevc] encode part file metadata
Fixes https://github.com/dart-lang/sdk/issues/37074

Hand-tested on flutter gallery.  E.g.,:
> dart.getParts('package:flutter_web_ui/ui.dart')
(15) ["src/ui/canvas.dart", "src/ui/compositing.dart", "src/ui/debug_canvas_reuse_overlay.dart", "src/ui/geometry.dart", "src/ui/hash_codes.dart", "src/ui/initialization.dart", "src/ui/lerp.dart", "src/ui/natives.dart", "src/ui/painting.dart", "src/ui/pointer.dart", "src/ui/semantics.dart", "src/ui/browser_location.dart", "src/ui/text.dart", "src/ui/tile_mode.dart", "src/ui/window.dart"]

Change-Id: Ied734d9f3739886d6679a9a9bbeae854e432bc52
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103602
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2019-05-29 14:48:40 +00:00
Vijay Menon 96c2d3c303 [dartdevc] enable testing of ddc internals
Change-Id: I8f4753a9a1f2f9f61df0d045adf07ff75fe32907
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103820
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2019-05-28 19:33:05 +00:00
Vijay Menon 834587a78c [dartdevc] fix import/export declarations for es6 to add extension
d8 assumes a '.js' extension - e.g.,:
```
import { core, dart, dartx } from 'dart_sdk.js';
```

Note: this will enable Siggi's modular compilation framework to run DDC tests on d8.

Change-Id: I1167a36e1454950149fecb8abc793728a16e4591
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103780
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2019-05-28 18:48:55 +00:00
Nicholas Shahan d06592b532 [dartdevc] Add details to failed assertion messages
* Source file location
* Assertion source code

This change embeds the information as strings into the compiled source. In the
future we could reconstruct the source file location at runtime from the stack
trace.

In tests with various large applications this added roughly 1MB (0.1MB
compressed) or less to the compiled file size.

Fixes: #36995
Change-Id: I2634f7eab6e54eec209094b52429987dd62c0828
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103568
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2019-05-28 18:03:38 +00:00
Aske Simon Christensen 1025c5bebb [DDC] Only inline textually small constants.
Fixes https://github.com/dart-lang/sdk/issues/36535

Change-Id: I62ad6d6f7390284d0a7a52d0d4b31e57ea1fbea6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103623
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
2019-05-27 11:45:08 +00:00
Régis Crelier 735669190e [corelib BigInt] Fix implementation of BigInt.modInverse (fixes issue #37008).
A negative result was wrongly returned as a positive value.
Since positive values are preferred, the implementation now adds the modulus
enough times to make the result positive.

Change-Id: I87a2ceb359345846740a749ab6b46b1d45e7ba21
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103664
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2019-05-25 22:05:51 +00:00
Robert Nystrom 70bd05e662 Stop ignoring runtime cast failures on function types.
Change-Id: Id3485e04aafea988604663e893818672d98dc8b0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103662
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
2019-05-24 23:52:08 +00:00
Vijay Menon 77f2603052 [dartdevc] preliminary nnbd support
For analyzer backend only:
* Implements `x!`
* Uses non-null type info where possible to elide null checks.
* Does not yet reify.

No hurry on this - starting to look at what's there.  Some notes:
* NNBD doesn't seem to be exposed directly on DartType yet.
* x!.y doesn't seem to parse - need to write (x!).y.
* Can't run existing tests yet - `package:expect`, etc., have NNBD errors.

Change-Id: I58c24c950d00f3a40d789d4a7adf049786977c50
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103040
Commit-Queue: Vijay Menon <vsm@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2019-05-24 15:04:25 +00:00
Vijay Menon caac50d7ff [dartdevc] Fix metalet regression
Hitting this when compiling the analyzer with DDC.  I thought this was exercised
when training the DDC snapshot (it compiles itself), but it seems not.

Lost the assignment here on the recent implicit cast removal.

Change-Id: Id1a74999c75b2a36071bac3692c2022e7ad7eefe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103482
Commit-Queue: Vijay Menon <vsm@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
Auto-Submit: Vijay Menon <vsm@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2019-05-22 19:12:10 +00:00
Vijay Menon efde7dd642 [dartdevc] fix assert
Hitting this when compiling the analyzer with ddc.  Should sanity check that our bots are
running with assertions enabled.

Change-Id: I1276b936162f3adc830a79d1f014c6dccd80de86
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103461
Auto-Submit: Vijay Menon <vsm@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2019-05-22 19:00:40 +00:00
Nate Bosch e15a98c4f2 Tighten types for runtimeStatement and runtimeCall
Only ~29/100 calls for runtimeCall and ~2/31 calls for runtimeStatement
were using the single value option. Change to take a `List<Object>`
always and add list literals to those calls which were previously only
passing one value.

Update pubspec SDk constraint so that the analyzer will allow the `..?`
syntax.

Change-Id: Ib8eb8eb854a8aa04e36dc5cc713016a43b8e9325
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103361
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
2019-05-22 17:38:15 +00:00