Commit Graph

113053 Commits

Author SHA1 Message Date
Nicholas Shahan 23bd610f97 [dwds] Copy changes from github
Copy into pkg/dwds and pkg/dwds_test_common.

* https://github.com/dart-lang/webdev/commit/ac63d06eb9a186f5799b5e6ecb97eb097562ed8a
* https://github.com/dart-lang/webdev/commit/f9a56607fac5ad0c979d2647cf11d3e3be993bf6
* https://github.com/dart-lang/webdev/commit/b2cd91f6ef8072847cba0cde33fe6e007403fb7b

Selectively revert incompatible changes to the pubspec.yaml files.

Change-Id: I4fc2bbd7440e699bb010262529edfc19a0fd3433
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/501221
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Jessy Yameogo <yjessy@google.com>
2026-05-06 16:14:04 -07:00
Alexander Aprelev 5a98fe5564 [vm/isolates] Avoid leaving isolate as part of native message handling.
Letting isolate go seems to be problematic. If this native messaging api is used during runtime call, then original isolate might end up on a different worker os thread causing remembered frame pointer(remembered as part of entering runtime call) to become invalid due to different stack bounds of this new thread. Invalid frame pointer causes immediate assertion failures during stack walk done for GC purposes or for exception handling.

TEST=ci, https://dart-review.git.corp.google.com/c/sdk/+/486522/comments/ee54d99f_a5c2a9d4

Change-Id: If69076bb9e107502dfef819de73829d9682bb134
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/501220
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2026-05-06 14:42:04 -07:00
Konstantin Shcheglov 0a5604c223 Support for cross-file context messages in test_runner/.
Bug: https://github.com/dart-lang/sdk/issues/63318
Change-Id: Ie02aef92d9ab0e04ce864a85ed6071d5e4b5e14f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/500820
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2026-05-06 13:23:57 -07:00
Konstantin Shcheglov 90073036fb AD. Run discardMemoryExpensiveData() when a driver switches to idle.
Discard memory-expensive driver data only when a driver first reaches
the idle work priority, instead of doing it on every scheduler loop
while it remains idle.

Track drivers whose idle discard has already run, and clear that state
when a driver gets more work or is removed. This preserves the
fine-dependency idle cleanup while avoiding repeated calls during long
idle periods.

Change-Id: If480e473fe2a1e8b6c4725cdd4ac4359afdba4a5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/500500
Reviewed-by: Paul Berry <paulberry@google.com>
2026-05-06 13:18:57 -07:00
Ryan Macnak 5bb366bb9f [gardening] Remove lib/async/future_test from isolate stress test.
Bug: https://github.com/dart-lang/sdk/issues/63333
Cq-Include-Trybots: luci.dart.try:iso-stress-linux-arm64-try,iso-stress-linux-x64-try
Change-Id: I9521563be52a902db0720b98c345d7502324d8b4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/501200
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2026-05-06 13:13:46 -07:00
Danny Tuppeny eb362d4261 [analysis_server] Support diagnostic server request for LSP-over-Legacy
Change-Id: I4793a70681360a8eeaf717457bd6b8b6f5eea8dc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/501180
Reviewed-by: Helin Shiah <helinx@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2026-05-06 12:47:27 -07:00
Paul Berry 7caaf2846d [docs] Improve link for filing breaking change requests.
Previously, the link text `Dart SDK issue tracker` in the breaking
change documentation pointed to the main page of the SDK issue
tracker. The user had to click `New issue` and select the template
`Propose a breaking change (for contributor use only).`.

With this change, the link goes straight to the template
(https://github.com/dart-lang/sdk/issues/new?template=6_breaking_change.yml),
which should streamline things a bit.

Change-Id: Idff83c28a27ca6e15a30d10b846b1a6f6a6a6964
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/501240
Auto-Submit: Paul Berry <paulberry@google.com>
Commit-Queue: Kevin Moore <kevmoo@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2026-05-06 12:38:38 -07:00
Konstantin Shcheglov 9f1438813f Fix JsonErrorFormatter to use right LineInfo for context messages.
Change-Id: Icd9e254308a54e47ea3be63220ada5fd028712e7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/500660
Reviewed-by: Paul Berry <paulberry@google.com>
2026-05-06 11:28:54 -07:00
Danny Tuppeny eed5d692ab [analysis_server] Only replace full paths or start of paths followed by separators during normalization
It's possible that there are nested paths in LSP workspace folders, such as:

/foo
/fooBar
/bar/foo

We shouldn't just replace each path we were given, as it might replace the wrong parts of other parts. Instead, require the path to be surrounded by quotes, or prefixed by a quote and followed by the appropriate path separator.


I also tweaked the benchmark test a little to report the time for the first call separately from the others, since that one triggers the regex build.

On my machine, timings currently are:

```
Replacing 250 paths in payload of 2097152 bytes
Iteration #1, First: 43ms, Rest: 30ms
Iteration #2, First: 38ms, Rest: 30ms
Iteration #3, First: 33ms, Rest: 30ms
Iteration #4, First: 37ms, Rest: 30ms
Iteration #5, First: 31ms, Rest: 29ms
```

Change-Id: I75de1fb36a16636e0f50099cced1d5386318d589
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/491640
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
2026-05-06 10:40:57 -07:00
Alexander Markov 27a5d75c2f [modular_aot] Code generation for UnaryBoolOp
Issue: https://github.com/dart-lang/sdk/issues/61635
Change-Id: Ia3913b94b6aa357b352d10572342fab3b55b4825
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/500482
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2026-05-06 09:48:04 -07:00
Alexander Markov 6251367ab1 [modular_aot] Compile closure functions and support captured variables
Issue: https://github.com/dart-lang/sdk/issues/61635
Change-Id: Ibbb4b4ed73c89f458e2b08898a96f4f1979965eb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/492663
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2026-05-06 09:47:58 -07:00
Konstantin Shcheglov a5ab51b142 CQ. Remove reportScannerErrors flag from Scanner.
Remove the `reportScannerErrors` option from `Scanner.tokenize`. The
parser handles scanner error tokens directly, so the scanner no longer
needs a mode that translates and reports them before parsing.

Update all callers to use the simplified `tokenize()` API. Adjust parser
recovery expectations where diagnostics are now reported at the
synthetic token location chosen by parser.

Change-Id: Ia2d479ba57b3156f1a4bab47c32444892c9d0aa4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/500361
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2026-05-06 09:13:11 -07:00
Danny Tuppeny 8b29e93bea [analysis_server] Include count of additional errors in "Rename anyway?" prompt
Follow up from https://dart-review.googlesource.com/c/sdk/+/499600

+ fix typo
+ fix bug that inline_method treated required named arguments as optional instead of required

Change-Id: I1c088138d990a27ed74ff51993bbe4032b245693
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/500780
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
2026-05-06 07:30:09 -07:00
Simon Binder 9514710249 [dart2wasm,standalone] Migrate everything except String
This migrates remaining dart2wasm patches to avoid js-interop outside
of passing strings.

Change-Id: I92a9bb6cb97305a51858901d27966c3bd0af8fc6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/491540
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2026-05-06 06:41:53 -07:00
Alexander Markov 69b84908a5 [vm,arm] Fix for crash in Subtype6TestCache on 32-bit arm
On 32-bit arm, when generating subtype test cache stub,
[delayed_type_args_reg] could be the same as [TypeTestABI::kInstanceReg]
(due to lack of registers).

As a result, when loading delayed type arguments from an instantiated
generic closure, [TypeTestABI::kInstanceReg] is eagerly overwritten,
which results in garbage delayed type arguments.

With the linear probe cache this would cause repeated cache misses.
With the hash-based cache this would cause a crash.

Bug: b/507666702
Change-Id: I1093f9277d874154a121ef644ecd7aa76320f789
TEST=runtime/tests/vm/dart/regress_b_507666702_test.dart
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/500842
Reviewed-by: Tess Strickland <sstrickl@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2026-05-06 06:41:04 -07:00
mohammadmseet-hue 794b281da3 fix: cap uncompressed WebSocket frame size to prevent peer-induced OOM
Closes https://github.com/dart-lang/sdk/pull/63257

GitOrigin-RevId: 47b50221f808d62c660d855b10cc1f22981c996a
Change-Id: I8c42b12277982caf0da5a627dc8de12102595d0b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/498460
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2026-05-06 04:54:42 -07:00
Ivan Inozemtsev 3c1e1ddb52 Finalize the changelog before stable update
Change-Id: I3f608e935d3ce9c29aabe0cfc58f0e066199e5e7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/501080
Auto-Submit: Ivan Inozemtsev <iinozemtsev@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Ivan Inozemtsev <iinozemtsev@google.com>
2026-05-06 02:34:52 -07:00
Johnni Winther a782aed439 [cfe][PrimaryConstructors] Add AsyncModifier
This adds an AsyncModifier class that holds both the AsyncMarker, used in the kernel encoding, and the file offset of the async modifier. This is used throughout the front end and ensures that the correct offset is used for errors reported on the async modifier.

Change-Id: If16d293ffb9b2e8fa8eca8c65f7548d920c5d56b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/500720
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Kallen Tu <kallentu@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2026-05-06 01:35:05 -07:00
Erik Ernst 0cbc0c3d82 Modify test_runner to run spec_parser on error tests
The test_runner skips test runs on all but front-end-only configurations
in the case where the test contains expectations that there will be
a compile-time error. This CL changes the "front-end-only"
classification such that the spec parser is included.

Before this CL, this implies that a test with a syntax error and an
expectation that this syntax error will be reported is simply skipped
when using `tools/test.py -c spec_parser ...`. With this CL, the
spec parser will be executed on that test, as it should.

Change-Id: I32ed313b5da20c189ca2f9b6b9ea3bb45f5072c7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/500721
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2026-05-06 01:34:54 -07:00
Kenzie Davisson a0e0688b21 Update DevTools rev to 23a1bf0ff30bc83b1dc16045d6d9b15da9b4bc9c
Change-Id: Ib46dfa0b30de394665ad6b0fb4f55cc5b0f93add
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/499801
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Kenzie Davisson <kenzieschmoll@google.com>
2026-05-05 17:30:59 -07:00
Nate Bosch fe2141ab1f [deps] rev ai, dartdoc, ecosystem, http, shelf, test, tools, web, webdev
Revisions updated by `dart tools/rev_sdk_deps.dart`.

ai (https://github.com/dart-lang/ai/compare/7270c43..9c96bfe):
  9c96bfe  Mon May 4 09:35:46 2026 -0700  Jacob MacDonald  Add test for DTD discovery (dart-lang/ai#465)
  af7e829  Mon May 4 08:36:10 2026 -0700  Jacob MacDonald  Add test for DTD discovery (dart-lang/ai#465)
  f151df9  Fri May 1 07:54:12 2026 -0700  dependabot[bot]  Bump actions/cache from 5.0.4 to 5.0.5 in the github-actions group (dart-lang/ai#464)
  03d251c  Thu Apr 30 12:34:59 2026 -0700  Jacob MacDonald  add obsolete issues skill (dart-lang/ai#462)

dartdoc (https://github.com/dart-lang/dartdoc/compare/2e30b8e..77a52b6):
  77a52b61  Tue May 5 19:38:04 2026 +0200  dependabot[bot]  Bump analyzer from 12.1.0 to 13.0.0 (dart-lang/dartdoc#4242)
  4fa2b5dd  Fri May 1 22:21:16 2026 +0000  dependabot[bot]  Bump the github-actions group with 3 updates (dart-lang/dartdoc#4241)

ecosystem (https://github.com/dart-lang/ecosystem/compare/ed4e053..319ff81):
  319ff81  Fri May 1 21:48:23 2026 +0000  dependabot[bot]  Bump the github-actions group with 3 updates (dart-lang/ecosystem#414)

http (https://github.com/dart-lang/http/compare/2c84f24..c140dc0):
  c140dc0  Mon May 4 13:22:37 2026 -0700  Brian Quinlan  feat(cronet_http): decode cronet exceptions (dart-lang/http#1912)
  057c768  Fri May 1 03:44:57 2026 +0000  dependabot[bot]  chore(deps): bump the github-actions group with 2 updates (dart-lang/http#1914)

shelf (https://github.com/dart-lang/shelf/compare/cc6b57d..74d58bc):
  74d58bc  Tue May 5 01:52:47 2026 -0700  Kevin Moore  [compliance] Update goldens - 7 fewer failures! (dart-lang/shelf#526)
  c6b3f75  Mon May 4 12:27:31 2026 -0700  dependabot[bot]  Bump actions/cache in the github-actions group across 1 directory (dart-lang/shelf#524)
  498d45e  Mon May 4 12:14:02 2026 -0700  Kevin Moore  test: make compliance golden tests "thoughtful" and clean up state (dart-lang/shelf#525)

test (https://github.com/dart-lang/test/compare/d5da922..14f99ec):
  14f99ecd  Fri May 1 16:18:32 2026 -0700  Nate Bosch  Track the OS for browser platforms (dart-lang/test#2449)
  fd2b4be6  Fri May 1 16:08:03 2026 -0700  Nate Bosch  Override test packages in coverage tests (dart-lang/test#2638)
  a1b82f18  Fri May 1 04:03:25 2026 +0000  dependabot[bot]  Bump the github-actions group with 3 updates (dart-lang/test#2637)

tools (https://github.com/dart-lang/tools/compare/c0dc794..6a7dd15):
  6a7dd157  Tue May 5 09:41:25 2026 -0700  Jacob MacDonald  support initial selection for multiselect, as well as select/unselect all (dart-lang/tools#2399)
  1a026068  Fri May 1 06:11:14 2026 +0000  dependabot[bot]  Bump actions/upload-pages-artifact from 4 to 5 in the github-actions group (dart-lang/tools#2392)

web (https://github.com/dart-lang/web/compare/7c908b1..294391c):
  294391c  Mon May 4 09:59:58 2026 -0700  Kevin Moore  [chore] Sort the members in elements.dart (dart-lang/web#544)
  41c4049  Mon May 4 09:35:13 2026 -0700  Kevin Moore  refactor: move most of the AST elements to their own file (dart-lang/web#543)

webdev (https://github.com/dart-lang/webdev/compare/d33d270..f9a5660):
  f9a56607  Fri May 1 14:48:09 2026 -0700  MarkZ  Splitting additional DWDS and Webdev tests between amd and ddc module systems (dart-lang/webdev#2828)
  b2cd91f6  Thu Apr 30 13:02:04 2026 -0700  Nicholas Shahan  [dwds] Prepare to publish 27.1.1 (dart-lang/webdev#2825)

Change-Id: Ifa3631598d554132a3f457a0e5d9e02089e5ce32
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/500980
Auto-Submit: Nate Bosch <nbosch@google.com>
Reviewed-by: Brian Quinlan <bquinlan@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
2026-05-05 16:24:22 -07:00
Paul Berry 27ed75b7bc [analysis server] Fix extra space when switching to new constructor syntax.
Adds logic to the `RemoveTypeName` correction producer to ensure that
after the correction is applied, the spacing matches what `dart
format` would do. For example, `C()` is changed to `new()` rather than
`new ()`, and `factory C()` is changed to `factory()` rather than
`factory ()`.

This will make it easier for me to visually inspect intermediate
results when transitioning the SDK and google3 to language version
3.13. It also should provide a (marginally) nicer user experience.

Change-Id: I30babde38e58438ea39279ed0d5859ce6a6a6964
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/500880
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2026-05-05 14:50:40 -07:00
Alexander Aprelev 25fcf6a551 [gardening] Add Platform::SetEnvironmentVariable to platform_fuchsia.cc
Follow-up to https://dart-review.googlesource.com/c/sdk/+/499300, fixes broken https://ci.chromium.org/p/dart/builders/ci.sandbox/vm-fuchsia-release-arm64/6670.

TEST=ci

Change-Id: Ifeff3f5ea62280458067b711c8a11d854b3cdb49
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/500920
Auto-Submit: Alexander Aprelev <aam@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2026-05-05 14:18:04 -07:00
Konstantin Shcheglov 921ec7f507 CQ. Simplify Scanner constructors.
Replace the positional Scanner constructors with a single constructor
that takes the input text and error reporting callback as named required
arguments.

Remove the unused fasta forwarding constructor, reader offset handling,
and stored first token. The scanner now keeps only the input text and
returns the token stream directly from tokenize.

Update analyzer, analysis server, plugin, CLI, scrape, and scanner test
call sites to use the named constructor arguments.

Change-Id: Ieabb7b28570d4a963563fb2d1c5ef5ac0c89032a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/500340
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2026-05-05 14:04:00 -07:00
Danny Tuppeny ac8b7adbaf [analysis_server] Add refactors for Add/Remove import prefixes
Fixes https://github.com/Dart-Code/Dart-Code/issues/4289

Change-Id: I875cbab9f36111cbbdd2b9723c1da80a0de72034
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/498700
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2026-05-05 12:53:41 -07:00
Konstantin Shcheglov 9cc76322a5 AD. Search references improvements: super formal, constructor via type alias, dot-shorthands.
Broaden search candidate selection to consider all names that can
syntactically denote an element, instead of only the element's own name.

Let the analysis driver answer reference-name queries for a set of
names. Use that to search for constructor references through declaring
type names, type aliases, and alias chains, including unnamed
constructors whose source spelling may omit the constructor name. Also
keep the declaring libraries in the candidate set so local references
are not filtered out before indexing.

Record super formal parameter names as referenced names. These names can
denote parameters from the selected super constructor, so they must be
available when narrowing files for search.

This improves reference search for constructor calls through type
aliases, dot-shorthand constructor invocations and tear-offs, and static
members used with dot shorthand or through an alias.

Fixes: https://github.com/dart-lang/sdk/issues/62219
Change-Id: Ia50ed3fd2e97f99d4aaf350314d08b930f86062c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/500280
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2026-05-05 12:24:58 -07:00
Konstantin Shcheglov d5783168c5 Augment. Link FormalParameterFragmentImpl(s) with adding synthetic missing up and down.
Keep each executable fragment's formal parameter list complete across an
augmentation chain by adding synthetic missing parameters both to
earlier fragments and to the current fragment. Link matching positional
parameters by position and named parameters by name, preserving
duplicate named parameters in declaration order.

This lets every formal parameter element have a fragment in each
executable fragment, while still allowing consumers that need only
written parameters to filter by `isOriginDeclaration`.

Update type building so synthetic fragments from other executable
fragments do not prevent the first real declaration from initializing
the parameter element type. Keep later real declarations from
overwriting a type that was already established by a previous real
fragment.

Add small collection helpers used by the new linking logic, and expand
augmentation element-model expectations to cover regular, field-formal,
and super-formal parameters with missing, reordered, duplicated, and
shape-changing parameters.

Change-Id: Ie4c959744385cb8dcc46bbbb5c5e9e4e5c30d461
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/500220
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2026-05-05 12:24:08 -07:00
Ben Konyi c5a57427d1 [ CLI ] Add support for modifying the environment from package:dartdev
This change makes it possible to set environment variables for the
current process from package:dartdev.

As a proof of concept, package:dartdev now sets `DART_ROOT` to the path
of the Dart SDK in the environment.

Related to https://github.com/dart-lang/sdk/issues/63210 and https://github.com/dart-lang/sdk/issues/62876

TEST=pkg/dartdev/test/environment_test.dart
Change-Id: If3a90279e99dadaba435ae3e43a752dcfda69227
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/499300
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2026-05-05 10:03:41 -07:00
Alexander Aprelev 5c3fb10fea [gardening] Fix fuchsia bot after broadcast InterfaceAddress changes.
Follow-up to https://dart.googlesource.com/sdk/+/6dd8ad53977bc864905248001a86375469415a32, broken bots https://ci.chromium.org/ui/p/dart/builders/ci.sandbox/vm-fuchsia-release-arm64/6667

TEST=ci

Change-Id: I16e8544f66c8f97866cd32a03b383e76ef7c9548
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/500840
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2026-05-05 09:53:54 -07:00
Brian Wilkerson e1cacdc23a Add a fix when an extension or mixin has a primary constructor
Neither is allowed to have a primary constructor, This adds a fix to
remove the primary constructor.

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

Change-Id: I363d2fa02d18e2a63a2bfc8c64a57256f861195d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/500584
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2026-05-05 09:18:55 -07:00
Alexander Aprelev 00cda4d60f [ffi/isolate_group] Move IsolateGroupBound callbacks from isolate to isolate group.
This allows creation of isolategroup-bound callbacks when isolate is not available. For example, to support proposed Isolate::onEvent/Isolate::handleEvent api https://github.com/dart-lang/language/blob/main/working/333%20-%20shared%20memory%20multithreading/shared_native_memory.md#additional-isolate-apis.

BUG=https://github.com/dart-lang/sdk/issues/63291
TEST=isolate_group_bound_callback_test

CoreLibraryReviewExempt: vm ffi-specific comments changes
Change-Id: I9a757a39ba8e152db64f59a66d337ca672103277
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/499661
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2026-05-05 08:37:06 -07:00
Martin Kustermann b10062cbbf [dart2wasm] Synthesize null when calling JS functions without result, Remove inlining in js interop transformer
When we call out to JS and the function type is declared as `void` we
don't observe the result from JS. That means we can import the JS
function as a wasm function type without results.

We then synthesize a `null` value, in case a caller of the external JS
function uses/observes the `void` result value.

=> This CL does the same for `JS<void>(...)` calls.

We also remove the "inline" replacement optimization in the js interop
transformer. That makes all `JS<...>()` calls to be handled in a uniform
way.

=> Our backend's inliner should inline it iff beneficial for size.

Change-Id: I78032aae0dcdcaaf52701c628cea71af1de0d5e6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/499880
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
2026-05-05 06:55:07 -07:00
Ivan Ugryumov 6dd8ad5397 Add InterfaceAddress for broadcast address support
Closes https://github.com/dart-lang/sdk/pull/63088

GitOrigin-RevId: c72afbbbf2774fd4c3c3f83b69c30e86e4302abd
Change-Id: I2462f006dcbe2256b019c5b13674ca0d93838fc0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/492180
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2026-05-05 01:15:37 -07:00
mohammadmseet-hue 4d6c9b756c fix: reject Set-Cookie with SameSite=None but no Secure attribute
Closes https://github.com/dart-lang/sdk/pull/63254

GitOrigin-RevId: 18d7d0e46c31783ff200657c0f81d029e9a64231
Change-Id: I3019e7733b6e2a3e1634b6bb7f8bb5e17be35d4e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/498423
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2026-05-05 00:53:33 -07:00
Jens Johansen 9c5d111556 [CFE] Convert import uri to file uri when there's no package config
This does leave some cases, but fixes what is probably the most common.

Small step towards https://github.com/dart-lang/sdk/issues/62645

Change-Id: I41c6b6e1aa135289a56e94595140a18789484dfb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/500421
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2026-05-05 00:35:02 -07:00
Konstantin Shcheglov f8b363a335 CQ. Format test_runner/
Change-Id: I24016d9a827e0506b2d5a6b6eed3356afaf90dbd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/500602
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2026-05-04 18:23:32 -07:00
Srujan Gaddam e534602bd5 [DEPS] Update d8/jsshell/jsc
Change-Id: Ie5dbbf73f8ca4ff0c41e263739baabec0fc2893d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/500601
Auto-Submit: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
2026-05-04 16:50:57 -07:00
Kallen Tu 8bfb683892 Enable 'primary-constructors' feature flag.
This CL enables the primary constructors feature by default in Dart 3.13.

The primary constructors feature is a brevity feature. There are no new semantics, but it allows us to express declarations in a less verbose way.

This feature allows one constructor and a set of instance variables to be specified in the header of a declaration.

Currently a declaration with a constructor and some fields is written as:

```dart
// Current syntax.
class Point {
  int x;
  int y;
  Point(this.x, this.y);
}
```

With a primary constructor, we would write the above as:

```
class Point(var int x, var int y);
```

If a primary constructor needs an initializer list or a body, they can be
specified inside the class using the `this` body syntax:

```dart
class Point(var int x, var int y) {
  this : assert(x >= 0) {
    print('Point created at $x, $y');
  }
}
```

As part of this feature, you can also use the `new` and `factory` keywords to
declare constructors in the class body without repeating the class name:
```dart
class Point {
  int x, y;

  // Equivalent to Point(this.x, this.y)
  new(this.x, this.y);

  // Equivalent to Point.origin()
  new origin() : x = 0, y = 0;

  // Equivalent to factory Point.clone(Point other)
  factory clone(Point other) => Point(other.x, other.y);
}
```

To learn more about the feature, check out the feature specification located here: https://github.com/dart-lang/language/blob/main/accepted/future-releases/primary-constructors/feature-specification.md

Tested: Has existing language, CFE, analyzer, analysis server tests.
Bug: https://github.com/dart-lang/sdk/issues/61524
Change-Id: I296f2fcd918b87bf2a1dd00256340759866c2423
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/489241
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Michael Thomsen <mit@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2026-05-04 15:09:49 -07:00
Nicholas Shahan 7e2f4855d4 [reload_test] Cleanup error message text
Remove extra close parenthesis and single quote from error message.

Change-Id: I67f6dabb872916b49e385fa43fdef0a22ef65b4f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/500580
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
2026-05-04 13:54:22 -07:00
Jake Macdonald 784b47c3ba Add skill to update SDK dependencies
Also adds an owners file for skills, allowing all eng.

Change-Id: Iefc970e31d3c2168b5b66e05b413e569072013be
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/493560
Reviewed-by: Reid Baker <reidbaker@google.com>
Auto-Submit: Jake Macdonald <jakemac@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2026-05-04 13:48:53 -07:00
Nicholas Shahan 3e0828907c [reload_test] Reformat pkg/reload_test
Change-Id: Idb0d35f552aad7c512fd7e19317c4cd1af1e9980
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/500241
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2026-05-04 12:11:51 -07:00
Ben Konyi c0df8bae2e [Service] Add support for specifying bind address to dart_runtime_service_vm
Also adds a Pool to protect against race conditions around managing the
HttpServer.

TEST=Manual

Change-Id: If748b6e5beb59c0b853e16477f0dac96ffafcaf3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/499760
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Jessy Yameogo <yjessy@google.com>
2026-05-04 10:48:35 -07:00
Ryan Macnak 97886e6dbf [vm, ffi] Remove special case for Fuchsia FFI callback thunks, take 2.
Require the embedder to place a blob containing the FFI callback stub at pkg/lib/ffi_callback_stub.bin. All blobs in the package can be loaded as executable VMOs.

Also reapply "Remove special case for simulator FFI callback thunks."

TEST=ci
Change-Id: I6ab4a73fc28fb750e45e67797b0bf9deee9d8b53
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/495840
Reviewed-by: Liam Appelbe <liama@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2026-05-04 10:45:15 -07:00
Ryan Macnak 017f2570d9 [test] Add missing FFI tests to the Fuchsia test package.
Change-Id: I333c5d99051e89b64aca9056b7892d245fda0fe6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/500480
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2026-05-04 10:40:32 -07:00
Paul Berry 9dfa6738c9 Revert "[flow analysis] Fix unsound type promotion in inner async/generator functions."
This reverts commit 3eb697c0af.

Reason for revert: Internal Google3 breakages

Original change's description:
> [flow analysis] Fix unsound type promotion in inner async/generator functions.
>
> An `await` expression or `yield` statement suspends the current
> function and allows other code in the same isolate to execute. In the
> case of nested functions, an `await` or `yield` in the inner function
> can allow the outer function to continue executing. That means that if
> the inner function promotes a local variable belonging to the outer
> function, then it isn't sound to carry that promotion past an `await`
> or `yield`.
>
> This change fixes the unsoundness by adding a flow analysis method
> `suspension`, which the shared type analysis logic uses to tell flow
> analysis that an `await` or `yield` has been found. The `suspension`
> method un-does the promotions of any variables that might be written
> to while the inner function is suspended.
>
> Fixes https://github.com/dart-lang/sdk/issues/62889.
>
> Change-Id: I77eaf997159819a7c50f44b67174d2aa6a6a6964
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/499382
> Reviewed-by: Johnni Winther <johnniwinther@google.com>
> Commit-Queue: Paul Berry <paulberry@google.com>
> Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
> Reviewed-by: Bob Nystrom <rnystrom@google.com>

Change-Id: I187ba9a347394946ecc8749d35dc7914d271b90a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/500540
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2026-05-04 10:37:11 -07:00
Ryan Macnak 46f31c3252 [build] Add missing symbol files to SDK.
These are used by the VM profiler and crash stack traces.

This should have been part of the dart/dartvm split.

Change-Id: I5f92669104f9cc216d60164c1801596e454eab9d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/499381
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2026-05-04 10:12:11 -07:00
Konstantin Shcheglov 26eee3ea66 CQ. Remove unused package:path/path.dart import form lib/src/generated/source.dart
Change-Id: Id1dc383a4d553df195042e030b5298c84b44b715
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/500481
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2026-05-04 09:57:27 -07:00
Nate Biggs a93219a4e1 [dart2js] Generate empty method bodies for external effect members.
The new @pragma('external-effect') causes the removal of invocations, including arguments, of any annotated member. This means the codegen builder shouldn't see any calls to these methods.

In a normal dart2js compilation this would mean we don't try to build bodies for the members. However, when running codegen in sharded mode, we have to be more conservative and assume another shard may need the member. Therefore one shard will still try to generate these methods.

We can just emit an empty member as the linker will exclude the unused method from the final JS code.

Change-Id: I28a82267f692f6a4921fe3b5207a7284f3fc8e0a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/500001
Reviewed-by: Stephen Adams <sra@google.com>
2026-05-04 09:31:30 -07:00
Alexander Markov 470f6e9fad [modular_aot] Regalloc fixes
Issue: https://github.com/dart-lang/sdk/issues/61635
Change-Id: Idceb800084ace76b880f170683686b532ac4df67
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/499941
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2026-05-04 08:16:18 -07:00
Lasse R.H. Nielsen f35a3fcce4 Add alternatives for functions that should be deprecated.
`List.unmodifiable` and `Map.unmodifiable` is as badly typed
as `List.from` and `Map.from`, but does not have a better-typed
`.of` constructor. This adds such, to give a migration target
when deprecating the badly typed constructors.

The `Future.delayed` with no second argument is also unsafely
typed, it fails if the type argument is not nullable.
The `Future.pause` creates `Future<void>` instead.

CoreLibraryReviewExempt: No new or platform specific behavior.
Change-Id: Iba101b3dc62f412003abd501fa042aca0ce63116
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/499280
Commit-Queue: Lasse Nielsen <lrn@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2026-05-04 08:08:35 -07:00