Commit graph

77044 commits

Author SHA1 Message Date
Daco Harkes 550d580d5e [vm/ffi] Fuchsia FFI testing package
This does not include enabling the FFI on Fuchsia. So these tests will
fail without the dependent CL.

This CL adds an `all_positive.dart` test file to be packaged in the
.far file, such that it is easier to run all FFI tests in one go.

We don't run tests on the bots, but we do build this test package on
the bots.

To build the .far files locally:
```
tools/build.py --os=fuchsia -m debug fuchsia_ffi_test_package
tools/build.py --os=fuchsia -m debug -a arm64 fuchsia_ffi_test_package
```

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

Change-Id: Iec418e0c10d77afbf811fb83151664bcc2710b99
Cq-Include-Trybots: luci.dart.try:vm-fuchsia-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175484
Reviewed-by: Liam Appelbe <liama@google.com>
2020-12-10 12:15:17 +00:00
Daco Harkes cae99dc82d [vm] Update fuchsia emulator
Bump the fuchsia emulator to a version in which the arm64 emulator
does not get stuck. We don't use this anywhere on the bots, but when
running locally.

Issue: https://bugs.fuchsia.dev/p/fuchsia/issues/detail?id=61157
Issue: https://github.com/dart-lang/sdk/issues/38752
Issue: https://github.com/dart-lang/sdk/issues/44434

Change-Id: I7e8fa33058f1fec06e7afcb1a579a24da8fa2fed
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175483
Reviewed-by: Liam Appelbe <liama@google.com>
2020-12-10 12:15:17 +00:00
Daco Harkes 4ccb45c172 [vm] Fuchsia arm64 build
Also runs the build on the existing Fuchsia bot and start building the
test .far on the bot.

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

TEST=tools/build.py --os=fuchsia -a arm64 create_sdk

Change-Id: I8ba92defb9318773552af7e178dea12460790004
Cq-Include-Trybots: luci.dart.try:vm-fuchsia-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175482
Reviewed-by: Liam Appelbe <liama@google.com>
2020-12-10 12:15:17 +00:00
Oleksii Khomchenko 64226729c1 [corelib] Add Set.unmodifiable backed by an UnmodifiableSetView
UnmodifiableSetView does not have backend specific implementations
(simillar to UnmodifiableMapView, unlike UnmodifiableListView).

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

Change-Id: I041bb6dc95d6a67a395ca75581ffe8e5933acdc6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/164103
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2020-12-10 11:00:27 +00:00
Johnni Winther 80161c3081 [cfe] Use Member.fileUri for DillMemberBuilder
Change-Id: Iab72b4975029fb262d4fd62a121b7d73a03edb53
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175640
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-12-10 10:17:17 +00:00
Jens Johansen c1d2c25ef1 [CFE] Add constant coverage in expect files
Change-Id: I0fc009708aa6e330366ad0689c4634a1df90d9c8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175368
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2020-12-10 08:57:17 +00:00
Srujan Gaddam 8e663541c9 [ddc] Change is checks for JS types
Changes 'is' checks for JS types such that it no longer does an
instance of check and instead only checks to see if the object
in question is a JS object or appropriate subtype. This means that
any two @JS objects will pass an is check and therefore can be
casted as one another. This makes it consistent with expected
behavior and dart2js.

Also amends the README to reflect the unified behavior.

Change-Id: I11aa105d6cafbbafde482b27dcc1182c0960cce9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/173140
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2020-12-10 01:38:26 +00:00
Srujan Gaddam 802d8b9835 Change js_mock_test to not use native types
js_mock_test currently tests mocks on native types by defining
the native types using JS interop. This is error-prone, as the
underlying native type has different type semantics than JS
interop types. Also moves these tests to lib/js and adds some
additional checks.

Change-Id: If4bba54d589a38d7f7fbf1c26c6c6f755ec6b9ad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/173361
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2020-12-10 01:38:26 +00:00
Sam Rawlins 1b130f47c1 Analyzer: Prepare some manually lazily initialized fields etc for null safety
* Add `/*late final*/ hints for fields which are manually lazily
  initialized in a public getter.
* Switch List(size) constructor with [] list literal.
* Force a few non-nullable types.
* Remove `null` assignments in embedder_tests.dart which change type of
  fields.
* Remove `null` Tokens in tests where null should not be.

Change-Id: I260657d222f6b8ca10e31d06991dc9e2cb575e5c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/171140
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-12-10 01:14:48 +00:00
Stephen Adams f0bd30b0ff [dart2js] disambiguate non-minified top-level closure names
In a big app there are a few hundred closures with names like 'closure321'.
These come from the initializer expressions of top-level variables.
Add the field name to these so the are a little more stable.

This is just for unminified closure class names and has no effect on
minified names.

Change-Id: I3fef4a950ef372cd9b53f984540f6197dd2a2f64
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175581
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2020-12-10 00:36:00 +00:00
Sam Rawlins 451bd1183b dart migrate: Support Windows newlines in opt out
Also sort test file.

Change-Id: Id8133d699ae1a71d1852ef29ce1f843c7ede98cc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175561
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2020-12-10 00:34:50 +00:00
Nate Bosch c88bc5d619 Update to latest package:convert
Improves pub package conventions.

Change-Id: Idd972794643114257879abda968c7c8bdf100937
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175582
Auto-Submit: Nate Bosch <nbosch@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
Commit-Queue: Kevin Moore <kevmoo@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
2020-12-10 00:25:10 +00:00
Sigmund Cherem 7f083fcf19 Fix no_such_method_test.
This test was broken since Dart 2.0.

It may be worth checking whether this provides any additional value to tests
available under the language suite.

Change-Id: I7c7c893d314041c4400c38e9293a4e5eda3cc072
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175007
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2020-12-09 23:15:00 +00:00
Mayank Patke 858479e095 [dart2js] Prevent minification in some dart2js/dart2js_2 tests.
Change-Id: I4be4068c76700767644bddc1d4067e451b2fff44
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175103
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Auto-Submit: Mayank Patke <fishythefish@google.com>
2020-12-09 23:06:52 +00:00
Nicholas Shahan 1bc1b8f854 [ddc] Avoid late variables in optimization
Hopefully this will avoid bugs in the future if the lowering of
late variables changes.

This does not change the current optimization for late variables
with list literal initializers. That lowering introduces a final
variable that is not marked as late that appears as the receiver
in this logic.

Change-Id: Ib99d0987b166d3f38b60d0dce3fedb166d772e64
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175444
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2020-12-09 22:33:10 +00:00
pq 15af6c6d48 linter 0.1.127
Change-Id: I028953d3696e1821db73f9549886ff77e42d70e0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175521
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2020-12-09 22:21:30 +00:00
Nicholas Shahan d0ee5dbe40 [ddc] Verify null safety modes of modules agree
Checks that the null safety mode of every module loaded matches the mode
of the SDK.

This relands https://dart-review.googlesource.com/c/sdk/+/173120 with
additional fix to correctly set the mode of a new component created
in the frontend_server.

Change-Id: I855b226f724ce0b6c83dbdc11ff6113853892dbb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/174881
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Anna Gringauze <annagrin@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2020-12-09 21:12:20 +00:00
Danny Tuppeny 4525525a9d [Analyzer] Handle parsing v3.16 LSP Spec
Change-Id: I6afd5c32673ba580cdf6691bdfa521766f65c3b0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158392
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-12-09 20:29:30 +00:00
Daco Harkes 4adebc6d2a [vm] remove unecessary store of x18 to Thread
Related issue: https://github.com/dart-lang/sdk/issues/44435

TEST=Unfortunately we have no tests set up for shadow call stack.

Change-Id: Ibea3662ba2ef563702288b7a52f816df3217aa41
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175367
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2020-12-09 20:08:00 +00:00
Konstantin Shcheglov 81d3244a8c Remove invalid factory constructors redirecting to abstract class.
According to the specification:
Otherwise, it is a compile-time error if R
denotes a generative constructor and D is abstract.

Not sure why we have these constructors at al.

Change-Id: I0ec671245c9b482c6455f7f5725b83db63b3c9db
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175361
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2020-12-09 19:41:30 +00:00
Ryan Macnak b957f09c6b [infra] Expand TSAN coverage.
Bug: https://github.com/dart-lang/sdk/issues/39611
Change-Id: I060403da4b5daff91b60805bad1e83865e021133
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/139496
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2020-12-09 19:31:50 +00:00
Devon Carew 55496c8a06 [dartdev] make the 'dart fix' command visible
Change-Id: I545242f2dbb0092f3d2e31b9cfbecbb2705df69f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175400
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2020-12-09 17:41:25 +00:00
Alexander Aprelev e45e4cad50 [vm/service] Fix calculation of heap size numbers for isolate groups
TEST=benchmarks/IsolateSpawnMemory with/without --enable-isolate-groups

Change-Id: Id8349839248323b84cbc743217cd4a380504c8b7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175520
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2020-12-09 17:36:20 +00:00
Johnni Winther 8103c90dbf [cfe] Use combined member signature in override inference in legacy code
+ emit only one message per method given that it now always has the
same root cause, namely that the combined member signature does not
exist.

Closes #31797

Change-Id: Id89a5557c5fdda1db087c20cbe92847dd08216a3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175305
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-12-09 17:33:20 +00:00
Lasse R.H. Nielsen b62ad8247f Switch order of socket tests to avoid timing issue.
Also fix one more place where ??= was appropriate.

Bug: https://github.com/dart-lang/sdk/issues/44414
Change-Id: I323bd0b82a1070a7e1341bee3a917564af45cafa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175360
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2020-12-09 16:19:00 +00:00
Sam Rawlins 88de6b438e dart migrate: Implement incremental migration in backend
This is still hiding behind a flag pending final review.

Bug: https://github.com/dart-lang/sdk/issues/44101 and
Change-Id: I01b7cb07b3fde7ac67105034b0c4057cb8a69771
     https://github.com/dart-lang/sdk/issues/44124
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175402
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2020-12-09 15:21:50 +00:00
Paul Berry a7ee05f27d Reland "Flow analysis: Track expression variables separately from promotion info."
This is a reland of fd2a6c6815

Original change's description:
> Flow analysis: Track expression variables separately from promotion info.
>
> Previously, we used a single class hierarchy, ExpressionInfo, to store
> all the information that flow analysis needs to know about a variable,
> including:
>
> 1. What is known about the program state if the expression evaluates
>    to true/false
>
> 2. Whether the expression is a `null` literal
>
> 3. Whether the expression is a reference to a variable.
>
> However, in order to address
> https://github.com/dart-lang/language/issues/1274 (Infer
> non-nullability from local boolean variables), we'll need #3 to be
> tracked orthogonally from #1, so that when a local boolean is referred
> to later, we can track information of type #1 and #3 simultaneously.
>
> However, it makes sense to keep #1 and #2 in the same data structure,
> because future work is planned to represent them in a more uniform
> way, as part of addressing
> https://github.com/dart-lang/language/issues/1224 (Using `if (foo?.bar
> == somethingNotNull)` should promote `foo`).
>
> Change-Id: I432f6e2e80543bb1d565b49403180c520eef66a5
> Bug: https://github.com/dart-lang/language/issues/1274
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175008
> Reviewed-by: Johnni Winther <johnniwinther@google.com>
> Commit-Queue: Paul Berry <paulberry@google.com>

Bug: https://github.com/dart-lang/language/issues/1274
Change-Id: I002adbde782887def50dc80ab6673411b321c341
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175362
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-12-09 14:36:50 +00:00
Jens Johansen c60398400e [parser] Recover better from 'required' parameter declaration in non-nnbd
Natural follow-up to https://github.com/dart-lang/sdk/issues/44379.

Change-Id: Idf73df0c9e8ce1f477d05aa73caf8975d2ffb9f2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175307
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-12-09 13:47:19 +00:00
Jens Johansen a8b372057e [parser] Recover better from 'late' field/variable declaration in non-nnbd
Fixes #44379
(https://github.com/dart-lang/sdk/issues/44379)

Change-Id: If97d0d57b1fe16777f6208b49a8b472420ac526a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175306
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-12-09 13:01:39 +00:00
Jens Johansen 869d75550d [CFE] Add comments and todos in crash test minimizer
Comments/todos the came to light in
https://dart-review.googlesource.com/c/sdk/+/174643

Change-Id: I29841862cc63325e1da052299c9c617bf651d5ca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175364
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2020-12-09 11:43:09 +00:00
Martin Kustermann 425780f410 [vm/concurrency] Share program structure and JITed code with --enable-isolate-groups
This removes our temporary scaffolding support for JIT isolate groups
(which was implemented by creating a new isolate group, loading the
application kernel into it and then merging the heap into the original
isolate group - maintaining a different object store)

It makes all isolates within a group share the same object store, same
libraries and JITed code. It will be conservative to start with, only
allow running unoptimized code, etc.

We will gradually remove the restrictions imposed by this CL:
  https://dart-review.googlesource.com/c/sdk/+/173970

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

TEST=Tests using --enable-isolate-groups with JIT sharing.

Change-Id: I2bf69a6fe3c905067c4cec2e81613f731c52e5ee
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175302
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2020-12-09 09:39:59 +00:00
Michal Terepeta 97093b2594 Watch Bazel generated files for changes
This introduces a way to see what paths have been searched for by
the `BazelWorkspace` and adds a polling-based watcher to detect
when files generated by Bazel appear (or have changed). This allows
us to re-analyze things automatically instead of, e.g., restarting
the server.

Change-Id: I60eae29b0e4fcc3a91d8d2275c6898e45548ea03
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/168649
Commit-Queue: Michal Terepeta <michalt@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2020-12-09 09:39:19 +00:00
Sigurd Meldgaard bf26eb3c94 Reland "Roll pub"
This is a reland of 41381e9598

Contains one more fix:
8ea96121d fix tryGitCommand

Original change's description:
> Roll pub
>
> a7e448b2 pub upgrade --major-versions (#2784)
> 06bcff09 pub upgrade foo, only unlocks foo from pubspec.lock (#2781)
> aa20a4bd Usage exceptions no stacktrace (#2776)
> 14e12bf6 Clarify error message when spawning a subprocess fails (#2763)
> 5ef0a0e7 Added a pub upgrade --nullsafety mode (#2741)
> 9cde2406 Fix pub remove --dry-run (#2774)
> 7426be94 Remove hack now issue has been fixed (#2773)
> 90a1f776 Limit retries in test to avoid timeout (#2765)
> 3aa327c7 Stop depending on .packages (#2764)
>
> Change-Id: Ifd8a8402c4628e7278b6fedfd2ca7902004fa6e8
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175241
> Auto-Submit: Jonas Jensen <jonasfj@google.com>
> Reviewed-by: Sigurd Meldgaard <sigurdm@google.com>
> Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>

Change-Id: Id50e6eca0372860f7087882a5c67141def07031c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175309
Reviewed-by: Jonas Jensen <jonasfj@google.com>
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
2020-12-09 09:06:59 +00:00
Nate Bosch d99629f8e0 Update to latest package:http_multi_server
Fixes a test for compatibility with google3.

Change-Id: Id85c531b6768b6a59f2f63e991de96dd92ab3232
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175446
Auto-Submit: Nate Bosch <nbosch@google.com>
Commit-Queue: David Morgan <davidmorgan@google.com>
Reviewed-by: David Morgan <davidmorgan@google.com>
2020-12-09 07:49:38 +00:00
Konstantin Shcheglov 2c7de33476 Report TYPE_ALIAS_CANNOT_REFERENCE_ITSELF for non-function type aliases.
Change-Id: I9ebcae63f4a5b708f25f9f41c5733ea701350a42
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175384
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-12-09 06:02:48 +00:00
Stephen Adams 35c7ebba1f [js_runtime] Specialize JSArray.addAll for JSArray input
Change-Id: I80b648a1a7c1cafb871618ccf57901047a374c19
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175344
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2020-12-09 05:23:08 +00:00
Konstantin Shcheglov a2d488123c Implement support for accessing static member when aliased type is InterfaceType.
Change-Id: Ia86338b409e0ee6f812924966a0d0eebf29597c5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175421
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-12-09 02:19:08 +00:00
Nate Bosch de8b2fbf6b Update to latest package:shelf
Change-Id: I4aa907e14358d631c5d895eed4da54330fe3cb8a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175460
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-12-09 01:45:38 +00:00
Nicholas Shahan 4c2edfd5b9 [html] Make cancel() always return synchronously
Before Null Safety, `_EventStreamSubscription.cancel()` used a trick
to run with synchronous timing even though it was typed to return a
`Future`. During the migration of the SDK to support Null Safety it
kept the synchronous timing in weak mode, but was changed to
asynchronous in sound mode so that the behavior matched the method
signature. In hindsight, changing the timing when opting into Null
Safety is problematic:

* A shared package has no control over what mode it runs in. Libraries
  may be opted in and run their tests with sound null safety but the
  apps they are used in could still be running in weak mode. This
  results in library unit tests that behave differently than the
  production app that deploys the code.

* This codepath can be triggered by EventTarget.dispatchEvent() from
  dart:html which should have synchronous timings for the event
  listeners before returning to the calling code. The asynchronous
  timing when running with sound null safety is inconsistent with the
  browser API.

This change reverses that migration decision and keeps the synchronous
timing in both modes. To support this in sound mode it returns a
special future value that is internal to the SDK and known to be used
for synchronous timing.

This change also removes the workaround introduced in DDC to avoid
warning/failing when `_EventStreamSubscription.cancel()` returned
null and the extra warnings/errors features were enabled in weak
null safety mode.

Change-Id: I6b08a2ada5b10120bea787ad59d1d58e6e181de5
Fixes: https://github.com/dart-lang/sdk/issues/44157
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175323
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-12-09 01:44:38 +00:00
Nate Bosch 87d5894a5a Update to latest package:http_multi_server
Change-Id: I1ba60a85020e11e0a1153f225793b9e3ae87e337
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175440
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-12-09 01:28:58 +00:00
Nate Bosch 2346d26253 Update to latest package:shelf_static
Change-Id: I49cf0ba2021a9eac848b299be8a94ae23f2a99f7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175441
Auto-Submit: Nate Bosch <nbosch@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
2020-12-09 01:28:50 +00:00
Ryan Macnak 1b160f79fe [vm] Gracefully handle loads not solicited by prefix.loadLibrary().
TEST=flutter
Bug: https://github.com/dart-lang/sdk/issues/41974
Change-Id: Ia0e99c5e84cdff8736c44e4e82ce40b045ed0207
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/174563
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2020-12-08 22:14:25 +00:00
Joshua Litt 7d64e39572 [dart2js] Add flag to specify maximum number of deferred code fragments.
Change-Id: Ifd85eb01c0be9de9ebbb157df616ef8765a4d5b5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158366
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2020-12-08 21:21:40 +00:00
Jacob MacDonald be09d34ff6 update mime to the null safe version
Change-Id: Ie411f2a236642a28513d59d619ed32c07693bd08
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175401
Auto-Submit: Jake Macdonald <jakemac@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2020-12-08 21:14:35 +00:00
Konstantin Shcheglov 2cf24e3b57 Evaluate TypeAliasElement in ConstantVisitor.
R=brianwilkerson@google.com

Change-Id: I53ce1ed1b838c0c2a3c977f9be930733b951547a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175383
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-12-08 21:13:35 +00:00
pq 60bec731a0 @doNoStore fixes for function expressions
Fixes: https://github.com/dart-lang/sdk/issues/44425

Change-Id: I5bac77d9a2961750b0037cd1d464ae059bcbe886
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175380
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2020-12-08 21:01:55 +00:00
Danny Tuppeny 0fa6674ea9 [Analyzer] Include required-named params in defaultArgumentListString and LSP complete-function-calls
Change-Id: I8b4c09305df6e868e7447c538be4a3b540aa7e57
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/174802
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-12-08 20:47:04 +00:00
Konstantin Shcheglov dbe003f6af Update AstRewriter to support non-function type aliases.
R=brianwilkerson@google.com

Change-Id: Id2bca0b3c8603fceea18628286412fea5a4598de
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175382
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-12-08 20:46:25 +00:00
Janice Collins 3040659aed Update dartdoc to 0.38.0.
Release notes:  https://github.com/dart-lang/dartdoc/releases/tag/v0.38.0


Change-Id: Idac8b626e279df5fae5f8837a5327a2c7b54395d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175381
Reviewed-by: Devon Carew <devoncarew@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
Auto-Submit: Janice Collins <jcollins@google.com>
2020-12-08 20:35:05 +00:00
pq 9cc78dce1f tweak description/disclaimer
Removes API migration from the description and ensures the disclaimer appears when run in a help context.

Sample output:


```
$ dart bin/dartdev.dart fix
Fix Dart source code.

This tool looks for and fixes analysis issues that have associated automated fixes.

To use the tool, run either 'dart fix --dry-run' for a preview of the proposed changes for a project, or
'dart fix --apply' to apply the changes.

Note: The `fix` command is provisional and subject to change or removal in future releases. Feedback is
welcome!

Usage: dart fix [arguments]
-h, --help       Print this usage information.
-n, --dry-run    Preview the proposed changes but make no changes.
    --apply      Apply the proposed changes.

Run "dart help" to see global options.

$ dart bin/dartdev.dart fix -n

Note: The `fix` command is provisional and subject to change or removal in future releases. Feedback is welcome!

Computing fixes in dartdev (dry run)... 15.2s
Nothing to fix!


$ dart bin/dartdev.dart fix --help
Fix Dart source code.

This tool looks for and fixes analysis issues that have associated automated fixes.

To use the tool, run either 'dart fix --dry-run' for a preview of the proposed changes for a project, or
'dart fix --apply' to apply the changes.

Note: The `fix` command is provisional and subject to change or removal in future releases. Feedback is
welcome!

Usage: dart fix [arguments]
-h, --help       Print this usage information.
-n, --dry-run    Preview the proposed changes but make no changes.
    --apply      Apply the proposed changes.

Run "dart help" to see global options.
```




Change-Id: I2fc03651d8a1605a9729bb4d62e382f533509d99
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175343
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
2020-12-08 19:39:05 +00:00