Commit graph

98946 commits

Author SHA1 Message Date
Daco Harkes cd9eaef675 [vm/ffi] Check Array<T extends Struct> bounds on []
TEST=tests/ffi/inline_array_test.dart

Bug: https://github.com/dart-lang/sdk/issues/54379
Change-Id: I2799056ce48fa8cfa590512b241fe72f61a07dbf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345060
Reviewed-by: Tess Strickland <sstrickl@google.com>
2024-01-05 12:35:49 +00:00
Daco Harkes d4f8f24dc8 [vm/ffi] Array fixes
`_checkIndex` was returning dynamic.

And it was missing for `PointerArray`.
Bug: https://github.com/dart-lang/sdk/issues/54379

TEST=tests/ffi/inline_array_test.dart

Change-Id: I148545e50463e89fb3a884757ef92444addefc61
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345000
Reviewed-by: Tess Strickland <sstrickl@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2024-01-05 12:35:49 +00:00
sgrekhov 6cf1148b5b [co19] Roll co19 to cd23849a5bf84a73466b5107e23bb04cf3d9b38a
2024-01-05 sgrekhov22@gmail.com Fixes dart-lang/co19#2465. Fix roll failures (dart-lang/co19#2466)
2024-01-04 sgrekhov22@gmail.com dart-lang/co19#2420. Add object-pattern exhaustiveness tests (dart-lang/co19#2454)
2024-01-04 sgrekhov22@gmail.com dart-lang/co19#2420. Add relational pattern exhaustiveness tests (dart-lang/co19#2463)
2024-01-03 sgrekhov22@gmail.com dart-lang/co19#2420. Add missed experimental flags (dart-lang/co19#2462)
2024-01-03 sgrekhov22@gmail.com Fixes dart-lang/co19#2436. Add test for external constructors with initializers (dart-lang/co19#2461)
2024-01-02 sgrekhov22@gmail.com dart-lang/co19#2420. Add more dynamic semantics extension type tests (dart-lang/co19#2459)
2024-01-02 sgrekhov22@gmail.com Fixes dart-lang/co19#2436. Add tests for external and redirecting constructors with initializing formals (dart-lang/co19#2460)
2023-12-29 sgrekhov22@gmail.com dart-lang/co19#1400. Add object pattern tests for extension types (dart-lang/co19#2456)
2023-12-29 sgrekhov22@gmail.com dart-lang/co19#1400. Add type inference tests for extension types (dart-lang/co19#2455)
2023-12-29 sgrekhov22@gmail.com dart-lang/co19#2420. Add switch statement check to the existing exhaustiveness tests (dart-lang/co19#2452)

Change-Id: Iee0668f14a35bb3c47aa67b35b1e5c6d8abe8021
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345040
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2024-01-05 11:13:26 +00:00
Phil Quitslund 3e319ba752 Revert "options map support scaffolding in driver"
This reverts commit 717ce7a69c.

Reason for revert: breaking Google3

Original change's description:
> options map support scaffolding in driver
>
> Konstantin and I chatted a bit about this so at least some of it shouldn't be too surprising to him but please do feel free to grab me to chat.
>
> That said a few pointers would be handy. Notably, this change:
>
> * introduces a new `SharedOptionsOptionsMap` for use in SDK drivers (and preserve current semantics)
>   * this is currently public but will be private once driver is more evolved to accommodate multiple options files
> * removes the shared `_analysisOptions` from the analysis driver with a baby step to using the one shared in SharedOptionsOptionsMap
> * removes context_builder and collection v2 experiments (and tests)
>   * I'll harvest some more functionality from these in future changes but for now they're distracting and hard to maintain
>
> This work is all to setup moving analysis options awareness into file state objects which will allow us to remove `sdkVersionConstraint` info from options (finally) and a host of other good stuff (see https://github.com/dart-lang/sdk/issues/54124).
>
>
>
> Change-Id: Ic4278184016d1018b4b5b1c6ac5ba9e2546927a5
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344860
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
> Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
> Commit-Queue: Phil Quitslund <pquitslund@google.com>

Change-Id: Ia988c5c9cd328d0adce3d8e6ff019e389819a957
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344960
Auto-Submit: Phil Quitslund <pquitslund@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-01-05 05:07:10 +00:00
Konstantin Shcheglov 437767f4ae Move more AnalysisDriver tests to DriverEventCollector.
Change-Id: If54cf494313fb21a2cb6e6b985f816581333cccf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344843
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-01-05 01:41:29 +00:00
Konstantin Shcheglov fafa97a9a4 Remove AnalysisDriverGeneric.
The Angular plugin does not exist anymore.
I don't see any use of this class in google3.
So, probably we can remove it.

Change-Id: Ied6b81d4d467e21be22c11fc53ecedd7f1c5b6a9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344901
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-01-05 00:51:07 +00:00
Sam Rawlins 7784cf3f94 analyzer: Do not overwrite an original exception when a plugin crashes
Maybe related to https://github.com/dart-lang/sdk/issues/38629. These tests have been skipped for so long, enabling them took some work, to migrate them from '.packages' files to package config files.

Some other tidying in the test file:

* inline `byteStorePath`, only used once.
* simplify `_packagesFileContent` and `_getPackagesFileContent`
  into a static getter.
* simplify `_defaultPluginContent` into a const String, so it can
  be used as a function parameter default value

The diff is way bigger than the functional changes, because we sort
elements.

Change-Id: I193316316750e80268b684fdc1abe558a77994fe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344601
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2024-01-05 00:27:30 +00:00
Srujan Gaddam 4110b48950 Use asyncTest instead of main async in JS interop tests
The former waits for the test to complete while the latter does
not. Testing this on d8 uncovered two issues which are also
addressed in this CL:

1. async_test has a Promise that is rejected before it is handled.
2. Tests that use Promises don't work correctly on dart2js + d8,
and are therefore skipped for now until the issue is resolved.

Change-Id: I1fac1f4c653bb9ee30ed683d1b0d11bfbf14a58c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/343682
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2024-01-05 00:21:29 +00:00
Srujan Gaddam c89939ffea [pkg:js] Prep for 0.7.0 publish
Change-Id: Ie220a6baa247464d38c3429fe003d3f4db828273
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344842
Auto-Submit: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2024-01-04 23:53:45 +00:00
pq ea758386d7 deprecate resolve2
Change-Id: Ifd21f5852ecea03837469da0e0bdd2bfa95e154c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344780
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-01-04 23:46:25 +00:00
pq 717ce7a69c options map support scaffolding in driver
Konstantin and I chatted a bit about this so at least some of it shouldn't be too surprising to him but please do feel free to grab me to chat.

That said a few pointers would be handy. Notably, this change:

* introduces a new `SharedOptionsOptionsMap` for use in SDK drivers (and preserve current semantics)
  * this is currently public but will be private once driver is more evolved to accommodate multiple options files
* removes the shared `_analysisOptions` from the analysis driver with a baby step to using the one shared in SharedOptionsOptionsMap
* removes context_builder and collection v2 experiments (and tests)
  * I'll harvest some more functionality from these in future changes but for now they're distracting and hard to maintain

This work is all to setup moving analysis options awareness into file state objects which will allow us to remove `sdkVersionConstraint` info from options (finally) and a host of other good stuff (see https://github.com/dart-lang/sdk/issues/54124).



Change-Id: Ic4278184016d1018b4b5b1c6ac5ba9e2546927a5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344860
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2024-01-04 23:45:42 +00:00
Konstantin Shcheglov a84e40b9e7 Move more AnalysisDriver tests to DriverEventCollector.
Change-Id: Ib9af15c217ca454da17b435b20a6fb6eeee1d8d6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344840
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-01-04 22:11:39 +00:00
Konstantin Shcheglov e50adef282 Extension type. Test for ImplicitCallReference.
Bug: https://github.com/dart-lang/sdk/issues/54340
Change-Id: Iff4ca8b10d4cafc57ce327a628eb57c6944ecd24
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344900
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-01-04 21:15:54 +00:00
Ömer Sinan Ağacan f713a7d844 [dart2wasm] Remove special case for const list access
When a const list access does not have a const argument, fall back to
normal compilation. TFA optimizes const list accesses to direct calls to
`_ListBase.[]`, so the code generated by the intrinsic handler is not
any better, and the generated code in the intrinsic handler does not do
bounds check.

Fixes test standalone/array_bounds_check_generalization_test.

Change-Id: I6455826815c22a731bb830aec08b8bdd701e0d52
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344820
Commit-Queue: Ömer Ağacan <omersa@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2024-01-04 20:38:38 +00:00
Ben Konyi 527cc7df50 [ DDS ] Reland 3.1.2 pubspec and CHANGELOG after 3.1.0+1 hotfix release
Change-Id: I2e451d3300c0c6a67f5559de4f361ffe54ea8f9d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344761
Commit-Queue: Christopher Fujino <fujino@google.com>
Reviewed-by: Christopher Fujino <fujino@google.com>
Auto-Submit: Ben Konyi <bkonyi@google.com>
2024-01-04 19:31:04 +00:00
Ben Konyi 5362a20f27 [ DDS ] Create 3.1.0+1 patch release
Reverts vm_service major version bump (13 -> 14) from 3.1.1, but is
otherwise identical to 3.1.2.

Change-Id: I9e6595a4a4565586284d7ab4601fd9e49711d87d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344760
Reviewed-by: Christopher Fujino <fujino@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2024-01-04 18:39:29 +00:00
Sam Rawlins 5ddb91860b analyzer: Close the ReceiverPort in PluginIsolateChannel.close
Change-Id: I7442da58ba9e6810bacc6380999097a3d9674658
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344623
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2024-01-04 18:38:36 +00:00
Danny Tuppeny 9e1dbb8be2 [analysis_server] Remove duplicate declaration tracking from LSP server
This code appears redundant. It was adding contexts to the declarations tracker as contexts changed, but this was also being done once at the end (in the method "addContextsToDeclarationsTracker" mentioned in the comment).

Apparently at some point I added a TODO suspecting this was unnecessary but didn't realise the performance implications of it on a large project.

There are existing tests that ensure the declarations are tracked correctly (although we don't use them for completions, they're still used to resolve macros in dartdocs).

See https://github.com/dart-lang/sdk/issues/54513

Change-Id: Ibdb7d00c288e78fc44c48a4f9febff688e2db323
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344702
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2024-01-04 17:51:58 +00:00
Danny Tuppeny 8212fbeedb [analyzer] Combine adding files + packages in declarations tracker to avoid enumerating analyzedFiles twice
Prior to this change, both `_scheduleContextFiles` and `_findPackages()`  would enumerate `_analysisContext.contextRoot.analyzedFiles()`. This is an Iterable that calls `getResource()` for every item so on large folders showed up on the profile:

https://github.com/dart-lang/sdk/issues/54513#issuecomment-1877065904

This change combines them into a single method so we iterate only once.

It does slightly change the order of things (SDK files were previously scheduled before packages), but the only alternative I have is to add `toList()` but that will need to allocate (and repeatedly grow) a list which I suspect is overall worse.

Other than the order, there should be no functional changes here - I moved the body of `_scheduleContextFiles` into `_findPackages()` and renamed it (which unfortunately doesn't diff nicely because it moved in the file).

See https://github.com/dart-lang/sdk/issues/54513

Change-Id: I2a5539a93ee8ca2cdbad031efcfc9bbaf23e9ab9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344703
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2024-01-04 17:27:43 +00:00
Konstantin Shcheglov 278f386c12 Rename AnalysisDriver.getResult() to getResolvedUnit()
Change-Id: I3262713dbc9736b7c4c6af9fbbc0b57d7f53d4d9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344660
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-01-04 17:07:58 +00:00
Jonas Termansen 8158275a94 Bump version to 3.4.
Do not revert: The main channel version must be upgraded now that the
version 3.3 beta has been cut and reverting this change puts the
release infrastructure into an unsupported state. Please fix forward
any potential problems that occur downstream and loop me into the
discussions so we can improve the release procedures in the future.

Change-Id: I8706c3d74fe0474d34a99c5cbbb8e9a88b586cdd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/329902
Commit-Queue: Jonas Termansen <sortie@google.com>
Reviewed-by: Kevin Chisholm <kevinjchisholm@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2024-01-04 16:15:09 +00:00
Tess Strickland 57a1168875 [pkg/vm] Create @pragma("vm:platform-const-if", <cond>) annotation
If a static field or getter is annotated with
@pragma("vm:platform-const-if", <cond>) and <cond> const evaluates
to true, then uses of the static field or getter are const evaluated
when a target operating system is available. If <cond> const evaluates
to any other value, then the annotation is ignored.

For example, when runtime-only code is guarded like the following,
using Flutter's kDebugMode constant, then debug mode Flutter programs
can alter the defaultTargetPlatform for testing, but in release mode,
the defaultTargetPlatform getter is const evaluated and code guarded
with defaultTargetPlatform checks can be eliminated if unreachable:

  @pragma("vm:platform-const-if", !kDebugMode)
  TargetPlatform get defaultTargetPlatform {
   ...
   assert(() {
     if (Platform.environment.containsKey('FLUTTER_TEST')) {
       result = TestPlatform.android;
     }
     return true;
   }());
   if (kDebugMode &&
       platform.debugDefaultTargetPlatformOverride != null) {
     result = platform.debugDefaultTargetPlatformOverride;
   }
   ...
  }

TEST=pkg/vm/test/transformations/vm_constant_evaluator

Change-Id: I55b88502a908c56cf42a761dd06741f15c8a23d9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/333220
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2024-01-04 14:44:29 +00:00
Ömer Sinan Ağacan 91d16af92b [kernel] Document how to compute Procedure type
Change-Id: I9772c3124a7c19e8754ba99edf355a6b76aaf1a9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344520
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
2024-01-04 12:04:12 +00:00
Konstantin Shcheglov 70783e5eb0 Macro. Prepare for reporting resolved macro generated files. Step #1.
Change-Id: Ib84e1aeef508cbfdd5b02d5c4c13420c5aa4daff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344421
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-01-03 23:07:29 +00:00
Konstantin Shcheglov d2b5f5f8d9 Macro. Introspection for EnumElement, tests.
Change-Id: I0029abd3f0dbbfb68aaec7cc8a0f9197a45df218
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344622
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-01-03 22:35:58 +00:00
Michael Thomsen 58209f70fd Update web tempate to use package:web
Change-Id: Ibe0e63abfd2390b92885110a4b22370c7425e231
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344640
Commit-Queue: Michael Thomsen <mit@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
2024-01-03 22:29:09 +00:00
pq a43ebbffd0 rename resolve2 to resolve
Not sure if there's a good reason to keep this as `resolve2` since there's no simpler `resolve` to be found. If there is, please let me know and I can revert this and add a doc to `resolve2` for clarification.


Change-Id: I67c3825e9db95ec3f3c618f08664ed655394c041
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344460
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2024-01-03 22:03:47 +00:00
Sam Rawlins cc8cc05819 analyzer: Improve text in diag pages: word-breaking, title-case, table
When looking at the Plugins page, I noticed it was not as friendly as the others.

"not running" text before: https://screenshot.googleplex.com/9Z2eMFSvVjKBjRv.png

Poor text wrapping before: https://screenshot.googleplex.com/BUaTxYxJ5W5yQti.png

Improved "Not running" text with better wrapping: https://screenshot.googleplex.com/69zoPfbGjYkeHD2.png

Improved path text, aligned as a table: https://screenshot.googleplex.com/6yKfbQo8BE7LHmp.png

Change-Id: I4a4cee23a93bf3c2f16d504a7b11cb9f29c7333c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344602
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Auto-Submit: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-01-03 21:59:49 +00:00
Mayank Patke ff9e8632de [dart2js] Remove throw from RecordGetterData.forEachParameter
Bug: #54468
Change-Id: Idb7b794a53c878285d00308394cb1206b0136826
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344380
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2024-01-03 21:12:35 +00:00
Devon Carew 70880b338e Bump web to 26c769a7a3d3162ad31ab3dd909c004e63f4d934
Changes:
```
> git log --format="%C(auto) %h %s" acf0beb..26c769a
 https://dart.googlesource.com/web.git/+/26c769a write additional version info into the readme (126)
 https://dart.googlesource.com/web.git/+/8e1c5c5 Bump actions/stale from 8.0.0 to 9.0.0 (132)
 https://dart.googlesource.com/web.git/+/ae2125b regenerate the dom bindings files using new api from package:code_builder (125)
 https://dart.googlesource.com/web.git/+/e170bf2 move the tool/bindings_generator dart+node script into the top-level bindings_generator/ directory (123)

```

Diff: https://dart.googlesource.com/web.git/+/acf0bebdd764d2400dc4e9e18577813c0f9e90c3..26c769a7a3d3162ad31ab3dd909c004e63f4d934/
Change-Id: I5c769f3f70b12d84b964bb8d50d5d50821a3849f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344620
Auto-Submit: Devon Carew <devoncarew@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2024-01-03 21:06:09 +00:00
Konstantin Shcheglov 33b98472b5 Macro. Introspection for top-level variables.
Change-Id: Ic3920e326d115fecde260da28053689a73a80d19
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344603
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-01-03 21:04:32 +00:00
Brian Wilkerson 542128079e Update lint messages to conform to docs
The documentation uses (or will use) 'lower_case_with_underscore', so
the messages should match. Also updated a comment.

Change-Id: Id424045c1b000929f783ce781307ded9f7c36bab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344500
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2024-01-03 20:53:40 +00:00
Danny Tuppeny 0a2c58e51c [dds/dap] Add missing awaits when resuming
These were lost in 35b560e289 and could result in an unhandled error when there's a race during shutdown if a request had been trying to resume an isolate.

Fixes https://github.com/flutter/flutter/issues/139181

Change-Id: Ie683f5afa801e8d05e15d93a0e2008cd0f74fe5d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344521
Reviewed-by: Helin Shiah <helinx@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2024-01-03 20:48:29 +00:00
Danny Tuppeny cd7bf37c1b [dds/dap] Don't throw errors for StackTrace requests on exited Isolates
I noticed a race while running from source today.. If you run a Dart CLI app we add --pause-isolates-on-exit to allow sending async output events before exiting, then we resume.

The stopped event is still propagated to the client (since there can be a delay between the stop and the resume while we wait for output events) and the client may ask for a StackTrace. If this arrives just after we resume the isolate, we would generate an error that could be shown to the user.

This adds a check that the thread ID is really invalid before throwing an error, and if it's valid (eg. it belongs to an earlier isolate) we just return an empty stack trace instead of an error.

Fixes https://github.com/Dart-Code/Dart-Code/issues/4907

Change-Id: I0a3241ffd634acea49b4d1dc7b3cd6b6b1c8d2d0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/342585
Reviewed-by: Helin Shiah <helinx@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2024-01-03 20:48:29 +00:00
Danny Tuppeny 793755f2c1 [dds/dap] Don't show stack traces in error messages from DAP
We accidentally started showing the stack traces in all errors rendered in VS Code. This changes the format of the message to not include the stack - although it keeps it in the payload to aid debugging when capturing logs.

It also slightly tweaks the error message for global eval to be less cryptic for VS Code.

Fixes https://github.com/Dart-Code/Dart-Code/issues/4899

Change-Id: Id4a0c4e6ef26065059e3becec62bab5d873e7be3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/342621
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Helin Shiah <helinx@google.com>
2024-01-03 20:48:29 +00:00
Danny Tuppeny db72826fbb [analysis_server] Don't treat Dartdocs following TODOs as continuations
Fixes https://github.com/dart-lang/sdk/issues/54476

Change-Id: I0658697285a59ba87e79cc9d04897a9780194615
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344580
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2024-01-03 20:46:59 +00:00
Devon Carew 9da8405656 Bump native to 0605d9ae6d2497737077539273992f8e1411286b
Changes:
```
> git log --format="%C(auto) %h %s" b668ca9..0605d9a
 https://dart.googlesource.com/native.git/+/0605d9ae [ffigen] Release 11 Stable (872)
 https://dart.googlesource.com/native.git/+/0ffdccc3 [ffigen] Search dylib in conda env path (869)
 https://dart.googlesource.com/native.git/+/793c4f53 [infra] Fix labeler.yml (873)
 https://dart.googlesource.com/native.git/+/a450a06d Bump actions/stale from 8.0.0 to 9.0.0 (870)
 https://dart.googlesource.com/native.git/+/0ab749d7 Bump actions/labeler from 4.3.0 to 5.0.0 (871)
 https://dart.googlesource.com/native.git/+/985ddd05 Fix clang "sometimes-uninitialized" and "unused-variable" warnings (865)
 https://dart.googlesource.com/native.git/+/8107f370 [native_toolchain_c] Export `environmentFromBatchFile` (864)
 https://dart.googlesource.com/native.git/+/2b1fbf84 [ffigen] fix syntax for leaf ffiNative functions (861)
 https://dart.googlesource.com/native.git/+/dbe57a18 [native_assets_cli] Add example using `dart_api_dl.h` (858)
 https://dart.googlesource.com/native.git/+/01f3e069 [infra] Skip coverage in health check (863)
 https://dart.googlesource.com/native.git/+/922b4214 Don't test web in health.yaml (859)

```

Diff: https://dart.googlesource.com/native.git/+/b668ca94f551fcebdeb3ce9f822170facced55ae..0605d9ae6d2497737077539273992f8e1411286b/
Change-Id: Id694719e5c5be0fa15ec16506ac5341756f4f4a2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344621
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Auto-Submit: Devon Carew <devoncarew@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2024-01-03 20:13:18 +00:00
Devon Carew 2a07d71f14 Bump webdev to b2405cba63064e655f1276a319ada842a8fb53bf
Changes:
```
> git log --format="%C(auto) %h %s" 8375cd6..b2405cb
 https://dart.googlesource.com/webdev.git/+/b2405cba Re-enable frontend_server_client tests (2327)
 https://dart.googlesource.com/webdev.git/+/d5bfbbd4 Bump actions/labeler from 4.3.0 to 5.0.0 (2323)
 https://dart.googlesource.com/webdev.git/+/d97ae014 Check sender ID in the Dart Debug Extension (2289)
 https://dart.googlesource.com/webdev.git/+/1e37cc8c blast repo changes: no-response (2313)
 https://dart.googlesource.com/webdev.git/+/3b2f67e9 Update package:vm_service constraints to allow version 14.x (2307)
 https://dart.googlesource.com/webdev.git/+/df21840e Fix `labeler.yml` (2324)
 https://dart.googlesource.com/webdev.git/+/ebcd0340 Reset Webdev to 3.4.0-wip after release of 3.3.0 (2326)
 https://dart.googlesource.com/webdev.git/+/b3bc179c Prepare Webdev for release to version 3.3.0 (2325)
 https://dart.googlesource.com/webdev.git/+/d596c4c6 Reset DWDS after release (2322)
 https://dart.googlesource.com/webdev.git/+/fd6ec444 Prepare DWDS for release to version 23.0.0 (2318)
 https://dart.googlesource.com/webdev.git/+/4c522a29 Add a test for Class inspection (2310)
 https://dart.googlesource.com/webdev.git/+/546a0373 Fix test cases failing with latest Dart SDK  (2312)
 https://dart.googlesource.com/webdev.git/+/75433458 Fix TestSdkConfigurationProvider.dispose (2308)
 https://dart.googlesource.com/webdev.git/+/a12368fb Fix `cast` error when debugging from VSCode (2303)
 https://dart.googlesource.com/webdev.git/+/b339a50c Send connection response to Cider (2302)
 https://dart.googlesource.com/webdev.git/+/c26b8c89 Send the Flutter inspector URL to Cider when requested  (2301)

```

Diff: https://dart.googlesource.com/webdev.git/+/8375cd66821550cb7a129315d97cd768c5fdd92c..b2405cba63064e655f1276a319ada842a8fb53bf/
Change-Id: Ic51653a07bf9d34ba72e1fb8d33c3616b3f17bd5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344542
Commit-Queue: Elliott Brooks <elliottbrooks@google.com>
Auto-Submit: Devon Carew <devoncarew@google.com>
Reviewed-by: Elliott Brooks <elliottbrooks@google.com>
2024-01-03 20:05:48 +00:00
Konstantin Shcheglov 8898abbc7e Issue 54485. Report error when external constructor has a field formal parameter.
Bug: https://github.com/dart-lang/sdk/issues/54485
Change-Id: Id2cec10b1c8bdb7bba5d608f28a3b55b8f4146ad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344180
Reviewed-by: Kallen Tu <kallentu@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-01-03 19:59:53 +00:00
Elliott Brooks af8d70367d [DAP] Catch any errors for getObject when requesting getters for a class
Bug: https://github.com/dart-lang/webdev/issues/2297
Change-Id: Id7234e7dd758e16ea05fb4b4ccab1593f3ca5ea8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/342704
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Elliott Brooks <elliottbrooks@google.com>
2024-01-03 19:43:42 +00:00
Parker Lougheed 78bab34c2d [pkg/vm] Use cross-platform URIs in resources.json generation
Consistently use file URIs when populating the `resources.json` file rather than converting them to platform-specific file paths.

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

TEST=Fix covered by existing test when ran on Windows.

Bug: https://github.com/dart-lang/sdk/issues/54129
Cq-Include-Trybots: luci.dart.try:pkg-win-release-arm64-try,pkg-win-release-try,pkg-linux-release-try
Change-Id: Ie18f8c4ab93e25a4ccd5b1532f1786959e808ae9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/343360
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Moritz Sümmermann <mosum@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2024-01-03 18:50:22 +00:00
Zach Anderson 59b02ea3a1 Revert "[linter] Account for new JS interop libraries in 'avoid_web_libraries_in_flutter'"
This reverts commit a7e1e26446.

Reason for revert: https://github.com/flutter/flutter/issues/140881

Original change's description:
> [linter] Account for new JS interop libraries in 'avoid_web_libraries_in_flutter'
>
> Users are going to begin interacting with the DOM and JS through these libraries more and more.
>
> To avoid new warnings later on, let's account for them as soon as possible.
>
> Change-Id: Ib86e00aeb4bf42f13e104c1b68910195737667d9
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/343700
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
> Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
> Reviewed-by: Phil Quitslund <pquitslund@google.com>
> Reviewed-by: Samuel Rawlins <srawlins@google.com>
> Auto-Submit: Parker Lougheed <parlough@gmail.com>

Change-Id: I6b3ec89ab18aa5d6a3bce43355025808256240d6
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344560
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
2024-01-03 16:13:08 +00:00
Sam Rawlins 8eec900fb6 analyzer: Fix doc comments for DocDirectiveType
See the current docs: https://pub.dev/documentation/analyzer/latest/dart_ast_doc_comment/DocDirectiveType.html for how these comments are misrendered now.
The links don't link, and the examples are accidentally rendered!

Change-Id: I10a1d188e91fd014590b60c7c6578a4852afa2ae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344441
Commit-Queue: Kallen Tu <kallentu@google.com>
Auto-Submit: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Kallen Tu <kallentu@google.com>
2024-01-03 15:35:19 +00:00
Parker Lougheed 43324f6959 [vm/compiler] Remove some unused code in redundancy_elimination
While I was trying to better understand the implementation in this file I got confused by the unused IsConstant function. So this CL removes it and some other unused code.

TEST=ci

Change-Id: Ie8953cbb0db04c65cb15ad613fa50f738d4e804a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344360
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2024-01-03 15:04:38 +00:00
Michael Thomsen 82cab5041e Clean up dart run help:
1) shown only most used options when verbose is off
2) regroup the options a bit

Before and after comparisons:
https://gist.github.com/mit-mit/c8b1338dd4ed784fd235b37840cb462f

Change-Id: I6f62664b801b745d065d3673292425eb740642ed
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/341962
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Michael Thomsen <mit@google.com>
2024-01-03 10:28:41 +00:00
Parker Lougheed f2e2c97600 [dart2wasm] Fix DateTime.timeZoneOffset calculation
This use of JS returns the value with the opposite sign of what it should be (in Dart). This is because Dart uses the difference between local time and UTC, while JS uses the opposite.

Also updates the test for this to also accept the longer style of timezone names as that is what Chrome and d8 on my mac are returning. I'm assuming that's why this wasn't caught earlier.

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

CoreLibraryReviewExempt: Specific to dart2wasm backend
Bug: https://github.com/dart-lang/sdk/issues/54448
Change-Id: I54ab721fa33ef638ccd158d08738ca68273a790b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/343520
Reviewed-by: Ömer Ağacan <omersa@google.com>
Auto-Submit: Parker Lougheed <parlough@gmail.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2024-01-03 08:53:48 +00:00
Daco Harkes 020421df65 [vm/ffi] Add Since annotation to Pointer + and -
To prevent breaking things on older SDKs when users chose to migrate.

CoreLibraryReviewExempt: VM & WASM only. Only adding an annotation.
Bug: https://github.com/dart-lang/sdk/issues/54250
Change-Id: Id026e34e78527117c571aa118445cd73b16f9a9a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344022
Auto-Submit: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2024-01-03 08:53:07 +00:00
Konstantin Shcheglov cb263c7d58 Macro. Run macros of class type aliases.
Change-Id: I03a633cb4354cada1f012425da8e36e9a2731c9f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344341
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-01-03 02:26:09 +00:00
asiva 01ac55d5f0 [VM/tests] Temporarily remove language/closure/type_arguments_test
from the isolate stress test list as it is failing

(see https://github.com/dart-lang/sdk/issues/54426)

Change-Id: I7f5df7faa2cdc633901e54829ff9a7ccd824f5a9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344461
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2024-01-03 01:20:09 +00:00
Srujan Gaddam 4804d54792 [dart:js_interop] Add support for dynamically importing modules
Closes https://github.com/dart-lang/sdk/issues/52852

Allows importing of modules using the JS "import()" expression.
The result is a promise that resolves to a module, from which users
can then access exported members from.

CoreLibraryReviewExempt: Backend-specific library.
Change-Id: I4c1caae689be55d1dbb038448e3243bcb80ac8b5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/343683
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2024-01-03 01:00:19 +00:00