Commit graph

76411 commits

Author SHA1 Message Date
Erik Ernst 3a7eeb6315 Rename is{Strong,Weak}Mode to has{Sound,Unsound}NullSafety
Change-Id: If3912d75c5f89a741299b2fae4299d01ac928eec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170424
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Michael Thomsen <mit@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2020-11-05 14:26:53 +00:00
Daco Harkes 633c5389a5 [vm/ffi] Document shadow space and restore RSP
Split off from https://dart-review.googlesource.com/c/sdk/+/140290.
We start using the stack after the C call, so RSP needs to be restored.

Issue https://github.com/dart-lang/sdk/issues/36730.

TEST=All existing FFI tests on windows.

Change-Id: Idcaff9007c1b6f42b95288e39470b3d6cca2ef56
Cq-Include-Trybots: luci.dart.try:vm-kernel-win-debug-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170425
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2020-11-05 13:58:43 +00:00
Daco Harkes b1946a51ed [vm/ffi] Rename NativeFundamentalType to NativePrimitiveType
These types are called object types in the C standard
(ISO/IEC 9899:2011) and fundamental types in C++
(https://en.cppreference.com/w/cpp/language/types) but more commonly
they are called primitive types
(https://en.wikipedia.org/wiki/Primitive_data_type).

Change-Id: I78ac9bee162e547a7b9b04cf142b274602c53d18
Cq-Include-Trybots: luci.dart.try:vm-precomp-ffi-qemu-linux-release-arm-try,vm-ffi-android-debug-arm64-try,vm-ffi-android-debug-arm-try,vm-kernel-linux-debug-x64-try,vm-kernel-linux-debug-ia32-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170429
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-11-05 13:57:53 +00:00
Daco Harkes 88de61b933 [vm/ffi] Refactor Zone arguments to first position
We pass `Zone* zone` usually as first argument to functions.
This was not the case in existing FFI code.

Addressing:
https://dart-review.googlesource.com/c/sdk/+/140290/37/runtime/vm/compiler/ffi/native_type.h#181

Change-Id: I858af575848d94381780800eda7a9c506f67eb3e
Cq-Include-Trybots: luci.dart.try:vm-precomp-ffi-qemu-linux-release-arm-try,vm-ffi-android-debug-arm64-try,vm-ffi-android-debug-arm-try,vm-kernel-linux-debug-x64-try,vm-kernel-linux-debug-ia32-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170428
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-11-05 13:57:53 +00:00
Sam Rawlins 60323ebce9 Analyzer: Add nullability hints to memory_file_system
The migration tool thinks the various parameters are nullable otherwise.

Change-Id: Ie24cf73bfd32ed4d4bade36a9d4fda76e1ca991a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170481
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-11-05 11:41:44 +00:00
Daco Harkes d9d0cc61c4 [vm] Remove old flutter_engine patches
Dart has rolled beyond these Dart SDK hashes in flutter/engine/DEPS.

Change-Id: Ib7dc7b7f746b8485348cef09d30f67bf3b965bac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170426
Auto-Submit: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Clement Skau <cskau@google.com>
Commit-Queue: Clement Skau <cskau@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2020-11-05 11:34:13 +00:00
Clement Skau 27ca552ddb [SDK] Replaces async's _AsyncAwaitCompleter with _Future.
Run time (less is better) impact:
dart:
- Calls.AwaitAsyncCall  -43.95% ~ -55.50%
- Calls.AwaitAsyncCallClosureTargetPolymorphic  -40.33% ~ -53.58%
- Calls.AwaitAsyncCallInstanceTargetPolymorphic  -42.69% ~ -55.65%
- Calls.AwaitFutureOrCallInstanceTargetPolymorphicManyAwaits  -42.05% ~ -56.14%
- Calls.Await...  0% ~ -13%
dart-aot:
- Calls.AwaitAsyncCall  -9.748% ~ -11.13%
- Calls.AwaitAsyncCallClosureTargetPolymorphic  -8.673% ~ -13.19%
- Calls.AwaitAsyncCallInstanceTargetPolymorphic  -9.799% ~ -11.74%
- Calls.AwaitFutureOrCallInstanceTargetPolymorphicManyAwaits  -5.412% ~ -13.43%

Code size impact:
- flutter_gallery_app_so_brotli_size  -0.1237% ~ -0.2410%
- flutter_gallery_readonlydata_size  0.1693% ~ 0.2041%
- flutter_gallery_instructions_size  0.1157% ~ 0.1779%
- flutter_gallery_total_size  0.1021% ~ 0.1413%

Bug: https://github.com/dart-lang/sdk/issues/39119
Change-Id: I64d28a8bea078277946d7be43737e265920c8f16
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126322
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-11-05 09:51:13 +00:00
Jens Johansen 7b75bd8ece [CFE] Special case StrongModeNNBDPackageOptOut message in IncrementalCompiler
This CL fixes the wrong message, so - when in the process of fixing
the package nnbd settings - one gets the correct message, mentioning the
right packages and no longer mentioning the fixed ones.

Change-Id: Ied26094055e56b44dfdd2e942b98eb9e1e7968fb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170423
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-11-05 09:43:23 +00:00
Jens Johansen 60a5c58196 [CFE] Fix not getting rid of NNBD error in package in incremental compiler
This fixes the issue of the error not going away, but can (see added
test) give a wrong error message when in the process of fixing the issues.

A follow-up CL will (try to) correct the wrong error message.

Change-Id: I3547fe5fb5cfd179897996029a00a4995a967e54
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170422
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2020-11-05 08:47:42 +00:00
Alexander Thomas 44f3881be6 [infra] Update checked-in SDKs to 2.12.0-0.0.dev
This is the first checked-in SDK with null-safety enabled by default.

Change-Id: I8f6fcdfd8856483f4737eb200ed4623a244cb0cd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170085
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2020-11-05 07:53:22 +00:00
Stephen Adams f387d24f68 [js_runtime] List.of improvements
`List.of` avoids per-element checks and no longer forwards to
the more expensive `List.from`.

Global type inference infers `List.of` and `List.from` as new
list allocations.

Bug: 40211
Bug: 32937

Change-Id: I54746610a1b0089ec54e43459301720105f872ef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170127
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2020-11-05 01:47:17 +00:00
Konstantin Shcheglov 2513d37525 Fix reported void_checks diagnostics.
Change-Id: I49b27cf3aab3606fb5b024cba3ed4b95e9ebe0f2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170420
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-11-04 23:50:37 +00:00
pq b5f1bbb2d7 simple fix dry-run
See: https://github.com/dart-lang/sdk/issues/43746

Change-Id: I0856471c22b2bb6f4487cca1147b8ad26fd29f93
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170405
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-11-04 22:41:07 +00:00
Ben Konyi 267db1871c [ VM ] Fix memory leak in main_options.cc
Caused by changes in ffc36db613 which
removed memory cleanup.

TEST=Existing tests surface the problem with ASAN enabled.

Change-Id: I4880a459e5421c754574778ad097984f2e47d885
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170440
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2020-11-04 22:33:27 +00:00
Brian Wilkerson 2d4070fa34 Fix a bug when adding a named parameter after removing all existing parameters
Change-Id: Ib43b154fb781ff50d32f4259ef198857835f9135
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170404
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-11-04 21:02:37 +00:00
asiva 5c0e6ba974 [Tests] - Fix legacy tests that broke when non nullability was enabled by default
1. lib_2/isolate/issue_6610_test - the source is served from a http request, the autodetect code causes the code to be served multiple times leading to 'count' being incremented multiple times.

2. standalone_2/http_launch_test - source is served from http request and hence the CFE auto opt out does not work for the spawned isolate

3. standalone_2/io/named_pipe_script_test - serves the source using a named pipe and the autodetect code does multiple fetches of the source resulting in an error

4. standalone_2/io/test_extension_test - spawns processes from a directory that is not auto opted out by CFE

TESTS = Fixes existing legacy tests.

Change-Id: I3c78055136659850ce068d6ab254279839d2414b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170280
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2020-11-04 20:58:57 +00:00
Ben Konyi 8988d1c18f [ Service ] Disable get_service_limit_rpc_test on NNBD precompiled bots
Change-Id: I1e9bac8206cc72509ba55ecbe6602694579423c6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170403
Reviewed-by: Liam Appelbe <liama@google.com>
2020-11-04 19:48:00 +00:00
Jonas Finnemann Jensen 65700b8940 Remove global variables from analytics in dartdev
Change-Id: Ic2b27ae5d1062c8227d082a050056685a3380c77
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170089
Commit-Queue: Jonas Jensen <jonasfj@google.com>
Auto-Submit: Jonas Jensen <jonasfj@google.com>
Reviewed-by: Sigurd Meldgaard <sigurdm@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2020-11-04 19:26:37 +00:00
Nate Bosch be70653a46 Update to latest package:source_span
Change-Id: Ie8851a9b20080fec8cacae7fc4a82c247db33fb0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170401
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-04 19:24:27 +00:00
Paul Berry 221c697f31 Migration: fix handling of .call on a function-typed expression.
Change-Id: Ibdee57d455215cd974ea34c8aeab578bd801f87b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170361
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-11-04 18:28:17 +00:00
Paul Berry a44fe3f778 Migration: set SDK min constraint appropriately.
As discussed in
https://github.com/dart-lang/sdk/issues/44031#issuecomment-720967259,
we want to encourage users to publish null safe packages with an SDK
min constraint matching the SDK version that was used for the
migration, e.g. `2.12.0-18.0.beta`.  However, we also want to make
sure that users doing migration via internal, dev, or bleeding edge
builds publish their null safe packages don't wind up inadvertently
publishing packages that are un-resolvable with the latest beta SDK,
so if the user is on one of those versions, we'll set their SDK min
constraint to `2.12.0-0`.

And of course, once the feature ships to stable, we'll want users to
publish their null safe packages with an SDK min constraint matching
the version in which null safety shipped to stable.

This CL implements all of that functionality, and tests it by
overriding the `version` file in the analyzer's mock SDK.

Change-Id: Ib9ed97e691271da0ed391a6c1a5fe209aa959dce
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170380
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-11-04 18:26:57 +00:00
Brian Wilkerson b499c76516 Add documentation for some additional diagnostics
Change-Id: Ideb16c6a4c20ebb8e474e8beae841d7bd15afe13
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170362
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-11-04 17:58:32 +00:00
Danny Tuppeny 648debb622 [Analyzer] Prevent NPE in Surround With assist
Fixes https://github.com/dart-lang/sdk/issues/42556.

Change-Id: I5d38fcbd7932a43da0ca40140cefdef593d6ea8f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/165020
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Danny Tuppeny <danny@tuppeny.com>
2020-11-04 17:52:17 +00:00
asiva 308c8059f3 [Tests] - Fix the spawnuri autodetect tests.
TESTS = existing tests are being fixed here

Change-Id: I9136017d29c11f73dd97c82364dc5ead8e2ae7d8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169407
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2020-11-04 17:50:27 +00:00
Ivan Inozemtsev 4a46b6511e Revert "[pkg/dartdev] refactor the migrate command to subclass DartdevCommand"
This reverts commit c10be63d51.

Reason for revert: this creates a circular dependency between nnbd_migration and dartdev which is hard to support internally

Original change's description:
> [pkg/dartdev] refactor the migrate command to subclass DartdevCommand
>
> Change-Id: I60f91f14e066b3a173f45b3c988830d5b435f2ed
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170206
> Reviewed-by: Ben Konyi <bkonyi@google.com>
> Commit-Queue: Devon Carew <devoncarew@google.com>

TBR=devoncarew@google.com,bkonyi@google.com,sigurdm@google.com

Change-Id: I3ba4648ea7f879ea4a893df2a9d75581a6f48dec
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170348
Reviewed-by: Ivan Inozemtsev <iinozemtsev@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Ivan Inozemtsev <iinozemtsev@google.com>
2020-11-04 17:22:59 +00:00
Devon Carew c10be63d51 [pkg/dartdev] refactor the migrate command to subclass DartdevCommand
Change-Id: I60f91f14e066b3a173f45b3c988830d5b435f2ed
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170206
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2020-11-04 16:28:47 +00:00
Brian Wilkerson a1977edddb Support a rename-parameter change for data-driven fixes
Change-Id: I9b2d168e3909e7477724a8feb6ae94b69a09950b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170260
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-11-04 16:18:47 +00:00
Jens Johansen 52297bf10e [CFE] Set main, mode and problemsJson for expect-file output in incremental compiler
This only makes the expect files more correct.

Change-Id: Ib15117f9e0a4aa09ceecfe914cb46e050469d56a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170341
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2020-11-04 13:19:27 +00:00
Johnni Winther 18c7c8bca5 [testing] Opt out generated script in pkg/testing
Change-Id: I1ecb67ad5c7dbd712a2b36fbe8c5b8a1a6fd14f9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170340
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-11-04 12:05:27 +00:00
Martin Kustermann 0358e0e07a [vm/dart2native] Ensure to normalize packages path (in addition to sourceFile) to guarantee consistency
The path normalization done by dart2native for "sourceFile" can cause
lower-casing of the path. We should do the same for the "packages" path.

TEST=Makes pkg/vm_snapshot_analysis/test/precompiler_trace_test pass on
     Windows in unittest-asserts-release-win config.

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

Change-Id: I3de0f2cc33d7a30280d4e815b0b7e3588f24e4f9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170093
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Clement Skau <cskau@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2020-11-04 11:13:36 +00:00
sheunglaili 7d64a93199 API doc issue: Update sqlite-tutorial CString section with correct ascii code
Closes https://github.com/dart-lang/sdk/pull/44042
https://github.com/dart-lang/sdk/pull/44042

GitOrigin-RevId: 2783fe93da270636d5453e03c6cd2c15b8e3c4cd
Change-Id: I663e840cee0d73002c401541bace0bd4016d8e36
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170161
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2020-11-04 10:31:47 +00:00
pq 97015a0f07 linter 0.1.123
Change-Id: I54514e377eb1b2e3cdfab078f940529c06b073a0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170320
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2020-11-04 06:22:06 +00:00
Konstantin Shcheglov 1726476120 Check for '!' operator when report HintCode.NULL_CHECK_ALWAYS_FAILS
Follow up for:
https://dart-review.googlesource.com/c/sdk/+/170122

Change-Id: If9b3cb1a18ecd7cf21149dbd0fda4ec209506b90
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170220
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-11-04 03:43:25 +00:00
Ben Konyi ffc36db613 [ CLI / VM ] Add --enable-experiment support for 'dart compile', change
where --enable experiment is accepted

Adds --enable-experiment support for:
  - dart compile aot-snapshot
  - dart compile jit-snapshot
  - dart compile js
  - dart compile exe
  - dart compile kernel

Also changes --enable-experiment from a top level CLI flag to a
per-command flag. --enable-experiment flags will now only be
interpreted by the VM if:

1) They are provided before a CLI command (e.g., dart
--enable-experiment=non-nullable analyze) or

2) They are provided with an explicit or implicit run command (e.g.,
dart --enable-experiment=non-nullable foo.dart or dart
--enable-experiment=non-nullable run foo.dart or dart run
--enable-experiment=non-nullable foo.dart)

This should make it more generally clear where --enable-experiment is
accepted and what subcommands can accept the flag. Prior to this change,
providing --enable-experiment anywhere, even for commands without
experiment support, would not raise an error.

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

Change-Id: I5ec48b2dd2bb6db5526185dae2edbca95ef24d9f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169902
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Sigurd Meldgaard <sigurdm@google.com>
Reviewed-by: Jonas Jensen <jonasfj@google.com>
2020-11-04 00:34:26 +00:00
Ben Konyi 2865802d93 [ Service ] Disable get_stack_limit_rpc_test on precompiled bots
Change-Id: I658d43ef9ad058766f117bdaa45a58590599e7a6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170281
Reviewed-by: Ben Konyi <bkonyi@google.com>
2020-11-04 00:29:27 +00:00
Jia Hao Goh 8c91d919b7 Treat integration_test/ as a directory for tests
This allows `invalid_use_of_visible_for_testing_member` to work with `@visibleForTesting` annotations when such symbols are accessed from an `integration_test/` package directory.

Bug: https://github.com/dart-lang/sdk/issues/43921
Change-Id: I530b88459060dbb05eb18d2a6de2902c88c246af
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169180
Auto-Submit: Jia Hao Goh <jiahaog@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-11-04 00:26:15 +00:00
Ben Konyi a486752050 Revert "[ DDS ] Keep event history for Stdout, Stderr, and Extension streams"
This reverts commit 892cc93f26.

Reason for revert: Causing assertion failures on pkg-linux-debug

Original change's description:
> [ DDS ] Keep event history for Stdout, Stderr, and Extension streams
>
> Change-Id: I14ce732cd408ece1da2801887cac3b518bc36af6
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169146
> Reviewed-by: Kenzie Schmoll <kenzieschmoll@google.com>
> Commit-Queue: Ben Konyi <bkonyi@google.com>

TBR=bkonyi@google.com,rmacnak@google.com,kenzieschmoll@google.com

Change-Id: Idf2a5f07433af0772ef36aaa2ba7b24b1a5e0323
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170300
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-11-04 00:25:37 +00:00
Devon Carew 282e3dc29f [pkg/dartdev] opt a test out of nnbd
Bug: https://github.com/dart-lang/sdk/issues/44050
Change-Id: Id102c927ec4918940050783aa23aed0dad03b341
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170241
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2020-11-03 23:04:07 +00:00
Paul Berry 92587baee5 Migration: fix "whereOrNull" transformation to handle complex targets.
Previously, when analyzing a call to an iterable method that could
potentially be transformed into an `OrNull` extension, such as:

  allMatches(str).firstWhere(..., orElse: () => null);

the migration tool would erroneously identify some subexpressions of
the call target (`str` in this example) as the argument supplied to
`orElse`, resulting in a crash.

This CL fixes the logic so that we use an `identical` check to verify
when we are looking at the argument to `orElse`.

Fixes #43956.

Bug: https://github.com/dart-lang/sdk/issues/43956
Change-Id: I2f4a0e81becf789cab5334d4926e014bda2772f4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170162
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-11-03 22:48:17 +00:00
Alexander Markov 0b3e6bd16c [vm] Enable non-nullable experiment in the VM by default
VM was not performing auto-detection of sound null safety mode
if --enable-experiment=non-nullable was not specified on the command
line. This change flips that logic to perform auto-detection unless
--enable-experiment=no-non-nullable is specified.

TEST=Added regression test runtime/tests/vm/dart/regress_44026_test.dart.

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

Change-Id: Ide8935e90dd3a8bd5a417aeb758605dedbb853eb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170201
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2020-11-03 22:29:08 +00:00
Ben Konyi 89de1e82d9 [ VM / Service ] Add optional 'limit' parameter to getStack RPC
Allows for clients to request the top N frames of the current stack.

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

Change-Id: Ia8d38e6317373024382a5e857faff73c89a0d2c0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169980
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Gary Roumanis <grouma@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-11-03 21:39:37 +00:00
Nate Bosch 7784843910 Bump SDK constraints in js for pub
Use a 2.12.0 lower bound since pub does not understand allowed
experiments for earlier versions.

Use a 3.0.0 upper bound to avoid a warning in pub and to give some
flexibility in publishing for stable.

Change-Id: I482e89becc7aa9f1a36298701ade70cbcc39702c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170204
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-03 21:28:47 +00:00
Nate Bosch d7a0c06108 Update to latest package:async
Migrates to `runZonedGuarded` from `runZoned` with an `onError`
argument.

Change-Id: I5636ce6c6718822440913f8344f6bc15aaec7999
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170203
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-03 21:01:08 +00:00
Nate Bosch 9ebbca4371 Bump SDK constraints in meta for pub
Use a 2.12.0 lower bound since pub does not understand allowed
experiments for earlier versions.

Use a 3.0.0 upper bound to avoid a warning in pub and to give some
flexibility in publishing for stable.

Change-Id: I3540dc3c085ac120997e107cfed5a991ad3f5ec4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170202
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-03 20:45:37 +00:00
Nate Bosch 64aaa0174e Update to latest package:stack_trace
Fixes async gap handling for VM stack traces.

Migrates to `runZonedGuarded` from `runZoned` with `onError`.

Change-Id: I8bcb543b4107d12c6be541a156b97aca754f4377
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170240
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-03 20:34:57 +00:00
Konstantin Shcheglov c0c453f7f1 Issue 44029. Use the function type itself as the type of '.call'.
Presubmit in google3 looks green.
https://test.corp.google.com/ui#id=OCL:340480353:BASE:340480464:1604433051239:7c3180b

Bug: https://github.com/dart-lang/sdk/issues/44029
Change-Id: Ifc02615aa92da7ae0369ef55657cf6b0e9cdb0bd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170200
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-11-03 19:59:07 +00:00
Janice Collins 6992e9da41 Update to dartdoc to rev matching v0.36.2.
Release notes:  https://github.com/dart-lang/dartdoc/releases/tag/v0.36.2

Tested:  spot checked that right version is built and null safety tags appear.

Bug: 44035
Change-Id: I84bbc5c7a7b715bf60d048bfbb3c802b8a7e5421
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170163
Auto-Submit: Janice Collins <jcollins@google.com>
Commit-Queue: Janice Collins <jcollins@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
2020-11-03 19:13:07 +00:00
Ben Konyi 892cc93f26 [ DDS ] Keep event history for Stdout, Stderr, and Extension streams
Change-Id: I14ce732cd408ece1da2801887cac3b518bc36af6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169146
Reviewed-by: Kenzie Schmoll <kenzieschmoll@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-11-03 19:09:47 +00:00
Sam Rawlins 090e234172 Remove unused dart:async imports
As of Dart 2.1, Future/Stream have been exported from dart:core.

Change-Id: Ia4d70d1ccb55ac117bafe630a24b4ee2f60ff993
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170126
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2020-11-03 18:49:54 +00:00
Sam Rawlins c6e4d6bcc8 Analyzer: new Hint: NULL_CHECK_ALWAYS_FAILS
This Hint reports when an expression of type Null is null-checked with `!`.
This check will always fail at runtime.

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

Change-Id: I6e2eac4f7b7720a6b9a1c02066470eb039aa9010
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170122
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2020-11-03 17:20:14 +00:00