Commit Graph

33318 Commits

Author SHA1 Message Date
Johnni Winther 3b24f36209 [frontend_server] Move ToStringTransformer to the Dart repo
The reduces the dependency of flutter/engine on the cfe internals.

Context: https://dart-review.googlesource.com/c/sdk/+/172180 had to be
reverted because the refactoring of the package:kernel code broke
the flutter/engine.

A follow-up CL is needed in the flutter repo to use the moved classes
instead.

Change-Id: I674ab3a09569d615b1549a5465da0f658945ec7e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/172762
Reviewed-by: Dan Field <dnfield@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-11-19 13:00:49 +00:00
Sigurd Meldgaard 4c5d27bfff Remove pub command
This file is no longer used since: https://dart-review.googlesource.com/c/sdk/+/168347 .

Change-Id: I039098894be40d5e028fca5b49719da66aa0cb9b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/172960
Reviewed-by: Jonas Jensen <jonasfj@google.com>
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
2020-11-19 12:03:19 +00:00
Danny Tuppeny 732305f11e [Analyzer] Don't show duplicate LSP code actions on same line
Fixes https://github.com/Dart-Code/Dart-Code/issues/2960.

Change-Id: I63361728e80c7db843db9e2b31e76eae78f85400
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/172562
Commit-Queue: Danny Tuppeny <danny@tuppeny.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-11-19 10:55:33 +00:00
Johnni Winther 3a8a9fe42b [cfe] Register parameters as initializes for expression evaluation
This fixes most skipped tests in https://dart-review.googlesource.com/c/sdk/+/172689

Closes #44235

Change-Id: Iafd84b815dd1a91fd2c8a8bec2669440c2552f00
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/172645
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Anna Gringauze <annagrin@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-11-19 10:49:03 +00:00
Danny Tuppeny 3bf25c6c40 [Analyzer] Support fix-all-for-file in LSP code fixes
Change-Id: Ic3628ee80c409feab178e237bccc5054501549e6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/172400
Commit-Queue: Danny Tuppeny <danny@tuppeny.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-11-19 10:44:13 +00:00
Ivan Inozemtsev d0f3471dd9 Bump protobuf, bazel_worker, and dart2js_info
Protobuf and bazel_worker are migrated to null safety, dart2js_info
just broadens dependency version range to be compatible with null safe
protobuf.

Also regenerate test protos in vm test cases and update expected ASTs
and add support for conditional expressions to protobuf aware tree shaker.

Change-Id: I019f0fd6c5688302cc5127e1be8368a3ea600439
TEST= Covered by existing tests
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/172646
Commit-Queue: Ivan Inozemtsev <iinozemtsev@google.com>
Reviewed-by: Ivan Inozemtsev <iinozemtsev@google.com>
Reviewed-by: Sigurd Meldgaard <sigurdm@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: David Morgan <davidmorgan@google.com>
2020-11-19 10:15:23 +00:00
Konstantin Shcheglov 590c4c4b30 PackageBuildWorkspace should stop at the first pubspec.yaml found, don't go up.
Change-Id: I1b996b34055d6887816313d333175869f570ada1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/172900
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-11-19 08:08:15 +00:00
Anna Gringauze 57cbfa73ed Add tests for expression compilation with sound null safety
Change-Id: I895b769ce203c2aed0cfcce9f1fca70f42dbb97c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/172689
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Anna Gringauze <annagrin@google.com>
2020-11-19 01:24:41 +00:00
pq 9219128bde summary presentation tweaks
See: https://github.com/dart-lang/sdk/issues/43746

Dry run:

```
Computing fixes in tmp_proj (dry run)...

3 proposed fixes in 1 file.

lib/main.dart
  annotate_overrides - 1 fix
  prefer_single_quotes - 2 fixes
```

Regular run:

```
Computing fixes in tmp_proj...
Applying fixes...

lib/main.dart
  prefer_single_quotes - 1 fix

1 fix made in 1 file.
```

Change-Id: I569b945027c807e4ff47c0eed99b7d9a64d4b8f0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/172823
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-11-19 00:09:11 +00:00
Ben Konyi a157ddbf94 [ DDS ] Add errorCode to DartDevelopmentServiceException to better
communicate reason for error

Change-Id: I5041558ad6370f873dc23515fdad1ec8a2cf4ba8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/172880
Reviewed-by: Jonah Williams <jonahwilliams@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-11-18 23:45:41 +00:00
Tess Strickland 3b9b77964d Reland "[vm/compiler] Move AssertAssignables out of closure bodies."
This is a reland of 42c76fd910

Main issue was due to the parameter order of the invoke field dispatcher
not matching the argument order described by its saved arguments
descriptor. There's no reason for it not to, so now it does.

Also fixes some issues with stack trace tests that failed due to
increased deduplication of closures by forbidding deduplication for
those tests.

TEST=Run on trybots of all architectures as well as flutter engine
trybot, new test added for downstream issues seen after initial landing.

Original change's description:
> [vm/compiler] Move AssertAssignables out of closure bodies.
>
> This CL moves the final set of checks out of closure bodies and into
> dynamic closure call dispatchers.  It also adds stubs for checking top
> types and null assignability for types only known at runtime.
>
> Fixes https://github.com/dart-lang/sdk/issues/40813 .
>
> Changes in Flutter gallery in release mode:
>
> * arm7: -3.05% total, +0.99% vmisolate, -0.89% isolate,
>         -1.20% readonly, -4.43% instructions
> * arm8: -3.20% total, +0.99% vmisolate, -0.88% isolate,
>         -1.18% readonly, -5.05% instructions
>
> TEST=Run on trybots of all architectures, includes test adjustments where needed.
>
> Cq-Include-Trybots: luci.dart.try:vm-kernel-linux-debug-x64-try,vm-kernel-nnbd-linux-debug-x64-try,vm-kernel-linux-debug-ia32-try,vm-kernel-nnbd-linux-debug-ia32-try,vm-kernel-precomp-linux-debug-simarm_x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-nnbd-linux-debug-simarm_x64-try,vm-kernel-precomp-nnbd-linux-debug-x64-try,vm-kernel-linux-release-simarm-try,vm-kernel-linux-release-simarm64-try,vm-kernel-nnbd-linux-release-simarm-try,vm-kernel-nnbd-linux-release-simarm64-try,vm-kernel-precomp-linux-release-simarm-try,vm-kernel-precomp-linux-release-simarm64-try,vm-kernel-precomp-nnbd-linux-release-simarm64-try
> Change-Id: Ifb136c64339be76a642ecbb4fda26b6ce8f871f9
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166622
> Commit-Queue: Tess Strickland <sstrickl@google.com>
> Reviewed-by: Martin Kustermann <kustermann@google.com>
> Reviewed-by: Régis Crelier <regis@google.com>

Change-Id: Ic5ec59cf355f7779bb82db798d97d762ba1e5556
Cq-Include-Trybots: luci.dart.try:vm-kernel-linux-debug-x64-try,vm-kernel-nnbd-linux-debug-x64-try,vm-kernel-linux-debug-ia32-try,vm-kernel-nnbd-linux-debug-ia32-try,vm-kernel-precomp-linux-debug-simarm_x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-nnbd-linux-debug-simarm_x64-try,vm-kernel-precomp-nnbd-linux-debug-x64-try,vm-kernel-linux-release-simarm-try,vm-kernel-linux-release-simarm64-try,vm-kernel-nnbd-linux-release-simarm-try,vm-kernel-nnbd-linux-release-simarm64-try,vm-kernel-precomp-linux-release-simarm-try,vm-kernel-precomp-linux-release-simarm64-try,vm-kernel-precomp-nnbd-linux-release-simarm64-try,vm-kernel-precomp-linux-product-x64-try,vm-kernel-linux-product-x64-try,flutter-engine-linux-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/172644
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-11-18 22:42:31 +00:00
Ben Konyi 1d1137666c [ CLI ] Fix issue where test was expecting different error message than
that reported on Windows

Change-Id: Ib907f4d8afd50456ff962a7769a1f79d9b150c87
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/172824
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2020-11-18 22:18:12 +00:00
Ben Konyi b0ccaf75a3 [ VM / CLI ] Fix issue where trying to snapshot a non-existent script would cause an assertion failure
Passing --snapshot should result in the CLI being bypassed (`dart compile`
should be used otherwise). Check to see if this option is provided when
attempting to parse the script name and always populate script_name in
that case.

Fixes https://github.com/dart-lang/sdk/issues/43785

TEST=Added regression test to the CLI package to exercise this path.

Fixed: 43785
Change-Id: Ifb67a5880f6b83c54e6deb6b0785b61fdcfc0ada
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/172820
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-11-18 20:01:04 +00:00
Ben Konyi 2a6971cba3 [ CLI ] Don't parse arguments when trying to run non-existent file
File checks are done after the initial argument parsing, so argument
parsing should stop once the first non-valid command/flag is reached.

Fixes https://github.com/dart-lang/sdk/issues/43991

Fixed: 43991
Change-Id: I42ac2d44eecc9b0bb32bb92f365bee30d173ee42
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/172744
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-11-18 20:01:03 +00:00
Devon Carew e3a626f804 [dart fix] sort dart fix output by error id
Change-Id: I19667bb7aed370e76fa9efb80fa4f1001eebc683
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/172800
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-11-18 18:49:11 +00:00
Sam Rawlins e228483736 dev_compiler: remove unused imports with shared prefixes
Bug: https://github.com/dart-lang/sdk/issues/38784
Change-Id: Ia29967ae40332db2e09d45b620acc7cbda4bbb7c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/172741
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2020-11-18 17:31:10 +00:00
Sam Rawlins f230313871 analysis_server: remove unused imports with shared prefixes
Bug: https://github.com/dart-lang/sdk/issues/38784
Change-Id: Ifd4df564247c08606841a0e22896d767da438a47
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/172740
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2020-11-18 17:30:21 +00:00
pq 4301645712 use ansi bullet
Fixes: https://github.com/dart-lang/sdk/issues/44241

Change-Id: Ia4d5daf92dea4ef15b8e38d07532caa1ece93f92
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/172742
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2020-11-18 16:28:30 +00:00
Johnni Winther 887ab360e5 Revert "[kernel] Ensure that visitors don't implicitly returns null"
This reverts commit 4a3f121341.

The changes broke flutter/engine

TEST=It's a revert!

Change-Id: I1e65e6cfab03795a21a64a96fe3ed72e6ba8ecd9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/172760
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2020-11-18 14:51:30 +00:00
Johnni Winther 4a3f121341 [kernel] Ensure that visitors don't implicitly returns null
This is in preparation to migrate package:kernel to null safety.
For the visitor interfaces to support non-nullable return types, the
implementations must avoid using `null` as return value in its base case.

TEST=Refactoring

Change-Id: I9f9b318982148d844be9826a5f8c88374a9fc402
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/172180
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2020-11-18 11:54:30 +00:00
Johnni Winther 3c2a5c8976 [cfe] Add forceUseSentinel for weak mode sentinels
When in weak mode non-nullable fields/locals can hold `null` and therefore
cannot use `null` as sentinel. When the backend supports sentinels, these
are therefore always used in weak mode.

Change-Id: I8b6ac7935d928b148af1c826fcf357502a1c8a41
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/172561
Reviewed-by: Mayank Patke <fishythefish@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-11-18 10:10:39 +00:00
Devon Carew 289bc8ce38 [analysis_server] rename and re-word analysis server CLI flags
Change-Id: If8084297b82596794500ee95f4683747152b7bb0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/172660
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-11-18 02:16:29 +00:00
pq 8b47021578 prefer convertPath
Follow-up from: https://dart-review.googlesource.com/c/sdk/+/172683/1

Change-Id: I5cb2371fcb6719e4b08ec512bad31031f1d28143
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/172687
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2020-11-18 01:49:49 +00:00
Konstantin Shcheglov 3dc16b2ad1 Improve test for inferencing operator== parameter type.
See https://dart-review.googlesource.com/c/sdk/+/124284
See https://github.com/dart-lang/language/issues/569

Change-Id: Idbd54bd33b70b22036e23364df4984ae92a55d04
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/172686
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-11-18 01:24:29 +00:00
pq df64dbc0ed windows path fix
Change-Id: I676a1e3b71e89880d7a3d9be8c6c9211eabc87c4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/172683
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2020-11-18 00:43:08 +00:00
pq f8c6ffb68b add dry-run summary details
See: https://github.com/dart-lang/sdk/issues/43746

Sample run (snipped):


[_fe_analyzer_shared] (master) $ dart ../dartdev/bin/dartdev.dart fix --dry-run

*** The `fix` command is provisional and subject to change or removal in future releases. ***

Computing fixes in _fe_analyzer_shared (dry run)... 18.5s

5945 proposed fixes in 115 files.

lib/src/base/errors.dart
  prefer_single_quotes • 9 fixes
  unnecessary_const • 14 fixes
  slash_for_doc_comments • 35 fixes
  prefer_equal_for_default_values • 1 fix
  unnecessary_this • 1 fix
lib/src/base/syntactic_entity.dart
  slash_for_doc_comments • 4 fixes
lib/src/flow_analysis/factory_type_test_helper.dart
  omit_local_variable_types • 2 fixes
lib/src/flow_analysis/flow_analysis.dart
  omit_local_variable_types • 189 fixes
  unnecessary_new • 73 fixes
  prefer_single_quotes • 7 fixes
  unnecessary_const • 1 fix
  avoid_init_to_null • 1 fix
  annotate_overrides • 3 fixes
  prefer_equal_for_default_values • 3 fixes
lib/src/messages/codes.dart
  omit_local_variable_types • 14 fixes
  prefer_single_quotes • 31 fixes
  annotate_overrides • 11 fixes
  unnecessary_new • 12 fixes
  prefer_equal_for_default_values • 2 fixes
  unnecessary_this • 1 fix
lib/src/messages/codes_generated.dart
  prefer_single_quotes • 1150 fixes
  unnecessary_new • 244 fixes
  unnecessary_const • 835 fixes
  omit_local_variable_types • 78 fixes
lib/src/messages/severity.dart
  unnecessary_const • 4 fixes
  prefer_single_quotes • 8 fixes

<snip>






Change-Id: Ic5b54771eeceeefeadd2d7de8023bdb5c9f45fa5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/172682
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2020-11-18 00:43:00 +00:00
pq 29a9fe27d2 bulk fix details server protocol
Change-Id: Id96fd8508018159959448c383baa53ad69b5828f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/172621
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-11-17 21:45:28 +00:00
Paul Berry d0a23d8106 Add a triage document for the dart migrate tool.
Change-Id: I4ba33889c6171d012fc6a4239f4409c5fe9de005
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/172661
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
2020-11-17 21:39:48 +00:00
Jens Johansen 0576d64a67 [CFE][kernel] Set parents on typedef children
Change-Id: Iccdd2b0c4c0062abc4e0cf50a2feadc4487941b7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/172563
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2020-11-17 17:52:18 +00:00
Alexander Markov d1f32cccd3 [vm/aot/tfa] Do not infer that late fields without initializer are nullable
This CL teaches TFA that late fields without initializer are not
default-initialized with null.

TEST=Existing tests for late fields + write_only_field3_nnbd TFA unit test.

Change-Id: I9719beab06248ec84dd2db794c3f6eacabeb9c6e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/172480
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-11-17 17:42:38 +00:00
Keerti Parthasarathy ed5f235c52 Fix windows test failure
Change-Id: I9700e4f86eaecd3bd003016fa2bb5a9ec8eaa417
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/172462
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2020-11-17 17:11:08 +00:00
Sigurd Meldgaard ce272daae8 [dart cli]: Use the correct package_config from dart run and dart test
Before `dart run` would always use the package config found by looking up the hierarchy from
whatever we got from getExecutableForCommand.

When that happened to be a precompiled snapshot this would work, because it would be ignored.

But if it would be a dart-file in another package (that would happen if that package is not cached)
we instead should resolve it relatively to the current working directory
(where the pubspec.yaml is also found).

Bug: https://github.com/dart-lang/sdk/issues/44214
Change-Id: Ib2e929c01ddc72babbcff91560236e08429f09f7
TEST=The new package config behavior is tested by the new test in: pkg/dartdev/test/commands/run_test.dart.
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/172181
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Jonas Jensen <jonasfj@google.com>
2020-11-17 10:20:00 +00:00
Sam Rawlins 95e4e03f88 Migrator: do not generate edit details twice on rerun
Fixes https://github.com/dart-lang/sdk/issues/44086

Change-Id: I99a23e5922a716bbd0c83e7c0f620686840ccd4c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/172300
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2020-11-17 05:05:00 +00:00
Keerti Parthasarathy 6b64d52de1 Add a method to remove unused FileState's.
Change-Id: I6e4644b48245c634cc31a6f32b19be68fd72786b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/171981
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2020-11-17 04:34:00 +00:00
pq f0c9321b14 bulk fix change mapping
Striving to do the "simplest thing that could possibly work" this may just be a conversation starter.


Change-Id: Id3deab6fd1541febbc090c696352563e6b5ce932
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/172460
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-11-17 00:45:30 +00:00
Ben Konyi c36ba8b50c [ package:dds ] Improve DDS error handling, add tests
Added tests to try and emulate failures reported in flutter_tools crash
reports. Used these tests to update error handling and get a better
understanding of exception scenarios.

Change-Id: Ie72822dafcc6373ebfeea543d93b934c0d0687f5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/172420
Reviewed-by: Jonah Williams <jonahwilliams@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-11-17 00:00:45 +00:00
Nicholas Shahan bfe8aa8d5b [ddc] Add option to throw null safety violations
Allows sound-like null safety when running mixed applications in weak
mode.

This is not a specified option and is only intended to assist large
scale migration efforts.

Change-Id: Icd0abb0e876d16e719a01e8381eef55a2b511051
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/171821
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
2020-11-16 22:58:50 +00:00
Nicholas Shahan 7878baf1eb [dart:html] Remove casts in cancel() method
Casts in _EventStreamSubscription.cancel() are causing unwanted failures
in ddc when we turn weak null safety warnings into errors via a flag. By
removing the casts more apps can run when the weak mode errors are
enabled. The null value is used inside the SDK to signal synchronous
behavior.

This is a temporary fix until we can resolve the larger issue with the
API in dart:html. See https://github.com/dart-lang/sdk/issues/44157.


Change-Id: Ic9651779a394a03f092a5b4b7944c1306afcb826
Issue: https://github.com/dart-lang/sdk/issues/41653
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/171660
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2020-11-16 22:52:10 +00:00
Nate Bosch aaf13b5247 Update to the latest package:yaml
Expand the range allowed by the dep from `package:analyzer`.

Switch dependencies to `any` for the packages which are `publish_to:
none`. The actual constraints aren't useful in these packages since they
are always pinned exactly by DEPS and so we can't trust they are kept up
to date.

Change-Id: Ibd937e8646574d49105f4dd0de2529e7ab30862a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/172380
Auto-Submit: Nate Bosch <nbosch@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
2020-11-16 22:16:50 +00:00
Konstantin Shcheglov bb6714c051 Issue 44220. Fix for NPE when checking for INVALID_REQUIRED_* for GenericFunctionType.
Bug: https://github.com/dart-lang/sdk/issues/44220
Change-Id: I7a88a8b34fbda140ab12e6861c0b00a5e5c420b7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/172360
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-11-16 22:06:40 +00:00
Paul Berry 4bde77e3c4 Migration: fix test_this_inside_extension.
This functionality is working now, the test was just broken.

Bug: https://github.com/dart-lang/sdk/issues/39387
Change-Id: I088a3bd40ac438d0a9cd2356badfaf9513aa4bbb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/172280
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-11-16 21:21:06 +00:00
Nicholas Shahan a6b76a610a [ddc] Optimize list control flow operations
Allows spread, collection for and collection if in list literals to
avoid unnecessary checks that the list is growable/modifiable and type
checks when adding the elements to the list.

Use a `push()` on the underlying JavaScript Array rather than calling
the exposed `add()` method.

The related ListCopy benchmarks show a performance increases between
10-40%.
https://golem.corp.goog/Comparison?repository=dart&team=dartdevc#targetA%3Ddartdevc%3BmachineTypeA%3Dlinux-x64%3BrevisionA%3D89256%3BpatchA%3Dnshahan-optimize-list-add%3BtargetB%3Ddartdevc%3BmachineTypeB%3Dlinux-x64%3BrevisionB%3D89253%3BpatchB%3DNone


Change-Id: I7e3ac3044d2af319a7ea40bbceef1d65ecec8261
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/172082
Reviewed-by: Mark Zhou <markzipan@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2020-11-16 20:31:46 +00:00
Joshua Litt b3d0a3c985 [dart2js] Add a SizeEstimator for js ast.
Change-Id: Id9d6c6ef26b38f5d28e14d51e60f6d3f5418fc33
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169800
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2020-11-16 20:18:06 +00:00
Sam Rawlins 0a4685822f analyzer_plugin: Remove unused imports which share a prefix
Bug: https://github.com/dart-lang/sdk/issues/38784
Change-Id: Ia1c1b2774ae483d30278dea4ee9d069104f7f1a2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/172301
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2020-11-16 20:09:46 +00:00
pq 5e9454cbbf infer set type from invocation expressions
Fixes: https://github.com/dart-lang/sdk/issues/44199

Change-Id: I61b76fdcd65fae180d3a1cc1926fe26d2e90ae49
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/172340
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2020-11-16 19:23:06 +00:00
Devon Carew 8bf0f4ed8c [analysis_server] remove the custom args parser
Change-Id: I2c7bfd290bd12d3b608f4b3628ec31a0ea522157
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/171961
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2020-11-16 18:32:08 +00:00
Paul Berry c0586277d7 Migration: fix handling of extensions on generic and function types
Bug: https://github.com/dart-lang/sdk/issues/39387
Change-Id: I037d29355dc86c071acc8dcc6f417a95e96e9728
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/172200
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-11-16 17:11:58 +00:00
Clement Skau 75a5ba9a21 [VM] Adds un-inlining for Service getStackTrace.
This adds back special handling of sync frames which was previously
dropped in 171584.
This is however needed to un-inline optimised frames.

https://dart-review.googlesource.com/c/sdk/+/171584

TEST=python tools/test.py -n dartk-linux-debug-x64 pkg/vm_service/test/get_stack_test

Bug: https://github.com/dart-lang/sdk/issues/44206
Change-Id: Ia24b24c05a1e5f4257b3723bc6e6d3d1dbac9c93
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/172220
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
Auto-Submit: Clement Skau <cskau@google.com>
2020-11-16 17:05:08 +00:00
Devon Carew cdbfe0af68 [test_matrix.json] perform additional analysis validation on the bots
Change-Id: Ia09c8734533e2ef5b59dad96861d3ecec29db8bc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/172029
Reviewed-by: David Morgan <davidmorgan@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2020-11-16 16:36:48 +00:00
Brian Wilkerson 25ff121c41 Offer to add async when a function should returns Future<void> but does not include a return statement
Bug: https://github.com/dart-lang/sdk/issues/43726
Change-Id: I8d44c8aa10cdd9af4391126b61a691a6a544a441
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/172028
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2020-11-16 16:28:15 +00:00