Commit Graph

107183 Commits

Author SHA1 Message Date
Ivan Inozemtsev 29e33b00d0 Reland "watchOS target os"
This is a reland of commit 7ae1d75869

TEST=manual, no watchOS SDK on bots yet.

Original change's description:
> watchOS target os
>
> - add support for --os=watchos | --os=watchos_simulator
> - do not depend on perfetto if dart_support_perfetto is false
> - change the default value for dart_support_perfetto to !is_watchos
>
> To minimize changes and to avoid modifying third-party zlib BUILD file, is_watchos implies is_ios for now.
>
> TEST=manual, no watchOS SDK on bots yet.
>
> Cq-Include-Trybots: luci.dart.try:vm-mac-debug-arm64-try,vm-mac-release-arm64-try
> Change-Id: If2130068ef546162a07a9ba53f94b11ff25fb565
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/415021
> Reviewed-by: Ryan Macnak <rmacnak@google.com>
> Commit-Queue: Ivan Inozemtsev <iinozemtsev@google.com>

Cq-Include-Trybots: luci.dart.try:vm-mac-debug-arm64-try,vm-mac-release-arm64-try
Change-Id: I2b50f7eb4da173627aeb4833b88a08712b278d9f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/425523
Commit-Queue: Ivan Inozemtsev <iinozemtsev@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2025-05-05 06:40:30 -07:00
Johnni Winther 918899974a [cfe] Add PrimaryConstructoFieldFragment
This creates a PrimaryConstructorFieldFragment instead of a FieldFragment for primary constructor fields (currently only occurring in extension types).

Change-Id: Iec58112a0a0ef64dba248f1ce93625e297b10705
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/426460
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2025-05-05 03:45:17 -07:00
Martin Kustermann df9e0f9729 [dart2wasm] Use polyfill for string constants if builtin isn't available
This makes us always emit strings into the `<app>.wasm` module only.
If the runtime doesn't support `js-string` builtin (and we
don't have `--require-js-string` builtin flag on) then we use a
JS Proxy object to resolve the string imports.

Now we only emit string constants in the `<app>.mjs` file iff those
cannot be encoded in the `<app>.wasm` file due to being invalid
utf-8 (such as unpaired surrogates, ...)

Change-Id: I7f4a0d61238e847c0c7dccadfa9e473f76512dc1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/426462
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2025-05-05 03:19:20 -07:00
Martin Kustermann c9e3c3324c [dart2wasm] Allow running dart2wasm tests on safari on Mac
This doesn't add a builder yet, but allows running tests locally on a Mac.

Change-Id: I1e1d1158d7d443df5896a759a669db47b1eb420f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/426461
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2025-05-05 03:18:29 -07:00
Jens Johansen ec831cf479 [analyzer] createPlainWorkspaceEdit can use passes line info
```
out/ReleaseX64/dart-sdk/bin/dart \
  pkg/analysis_server/tool/benchmark_tools/single_benchmarks/lsp_many_prefer_single_quotes_violations_benchmark.dart \
  --sizes=3200
```

goes from

```
Select all code action call: 10.684823
```

to

```
Select all code action call: 8.838016
```

Change-Id: Icbc08aaa8f6f4ac677afea6072d5af3590bd378c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/426120
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2025-05-05 02:54:09 -07:00
Robert Nystrom d6ef495a9a Format tests/lib/mirrors using 3.8 style.
Change-Id: I9f922f8a4106f993c63b55ebbe3c54ea999cbbd4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/426287
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
2025-05-05 02:31:55 -07:00
Robert Nystrom 36117c443c Format tests/lib/typed_data/ using 3.8 style.
Change-Id: I85d53883d8f976246cae6f3caece157f906cf829
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/426320
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
2025-05-05 02:24:20 -07:00
Robert Nystrom 8717ff636a Format tests/lib/math/ using 3.8 style.
Change-Id: Ib34bac4962df8927cf2952a4cc5e388c84dcea79
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/425984
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
2025-05-05 02:23:50 -07:00
Robert Nystrom 4e8a4a3b44 Format tests/modular/ using 3.8 style.
Change-Id: I059d96ef2db91ea43cc1a6d2fffd0d6e7718659b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/426288
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
2025-05-05 02:09:59 -07:00
Jens Johansen cddee72854 [analyzer] Don't find the same "fixes for all" multiple times
Before this CL, if one has a file like

```
Map<String, String> foo = {
  "1": "1",
  "2": "2",
  "3": "3",
[...]
```

with many violations of the prefer_single_quotes lint, using VSCode and
selecting all would lock up the analysis server, e.g. in
https://dart-review.googlesource.com/c/sdk/+/425503 I showed 400 such
lines taking ~36 seconds on my machine (and 800 such lines taking ~247
seconds).

This is because for each error (lint) in range (i.e. all of them) it
calculates fixes for all of them. Once it's done with that it
deduplicates and throws most of the data away again.

This CL instead only calculates the "fixes for all" for each
combination of error-type and generator, skipping lots of work,
making the whole thing be much faster.

In the data send to the client (VSCode in this instance) the
"diagnostics" for
"Convert to single quoted strings everywhere in file"
contains fewer elements (only 1, vs all before), but it's unclear when
(or if) this is used. Note that the "edit"s does contain all, and
applying it still changes all instances.

I now get these runtimes for the select all case (via the benchmark)
(with cpu governor "performance" which likely wasn't the case for
the ~36 seconds and ~247 seconds above, although it doesn't matter
much with these differences):

400: 0.736783
800: 1.502978
1600: 3.704314
3200: 10.701988

Change-Id: I2b69a77525c0e1ed720c2b3d1de70ccc1fc5e94c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/425861
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2025-05-05 01:50:25 -07:00
Johnni Winther b5e1ef4e14 [model] Update handling of ?.length in constants
This adds reporting of an error in CFE for ?.length in constant expressions and improves the message for the analyzer in the same case. The error in the analyzer was previously the invalid claim that

    The property 'length' can't be accessed on the type 'Null' in a constant expression.

Closes #60509

Change-Id: Ibbe0fa1ace3bea9d83efea2ccf3ea9716a125d74
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/421841
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-05-05 01:10:33 -07:00
Martin Kustermann 1504dc6362 [vm] Extend analyze_snapshot tool to emit more detailed information
In release builds most `Field` objects are tree shaken,
but if an instance field is e.g. a `late final` field then the `Field`
object is retained in the snapshot for the `LateInitializationError`
slow path. Though `Field` will not appear in `Class.fields()`, it
will only be referenced in the `ObjectPool`.

=> Instead of dumping `Class.fields()` we collect all `Field`s with
   the same owner and dump those (a superset of `Class.fields()`)

We dump more information for a `Field`: Whether it's a reference field
or unboxed field (in which case we dump what unboxed type it is). We
also dump field flags (e.g. `late`, `final`, `static`).

We also dump now a `instance_slots` property on the class which
describes every slot in the instance. If a slot in an instance
  * has a corresponding `Field` we emit `instance_field` type and
    the id of the `Field` object.
  * has no corresponding `Field` we emit a `unknown_slot` type
  * we emit whether the slot is a reference field

This brings the information the `analyze_snapshot` tool dumps closer to
what Blutter uses, but some differences remain, e.g.:

  * Blutter seems to scan constant instances of classes (if there's any)
    and tries to determine based on those constants what unboxed slots
    could mean.
    It may look at 8 bytes and "guess" whether it's more likely to be an
    integer or a double. (Side note: It doesn't consider
    `Float32x4`/`Float64x2`)
    => The guess can be incorrect, so we do not do that.

  * Blutter seems to scan constant instances of classes (if there's any)
    and tries to guess the type of a reference field based on what that
    constant's field points to.
    => The guess can be incorrect, so we do not do that.

go/dart-ama

TEST=vm/dart/analyze_snapshot_binary_test

Change-Id: I116560ba5e5f89d4349f2227362b8494e3af7a1c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/425261
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2025-05-05 01:04:25 -07:00
Johnni Winther a077989c9d [cfe] Return LookupResult from NameSpace.lookupLocalMember
This prepares for having getters and setters in the same builder.

Change-Id: If800e7cccf1e71dbb7bca628a91a6ab48d8737c3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/426162
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2025-05-05 00:46:15 -07:00
Robert Nystrom a323c55162 Format tests/standalone/ using 3.8 style.
Change-Id: I4d492a63a41880ef8cd69321372a4853825b9efd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/426321
Reviewed-by: Liam Appelbe <liama@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
2025-05-04 17:45:09 -07:00
Sam Rawlins 81ab0dab3c analyzer: Use Diagnostic instead of AnalysisError in lib/src
Work towards https://github.com/dart-lang/sdk/issues/60635

Change-Id: Ifce5f4919f5bb8e12ac73994263d1a9fe745e0e9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/426402
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-05-04 12:29:51 -07:00
Sam Rawlins cfa4be3d93 analyzer: Use DiagnosticSeverity in analyzer packages
Work towards https://github.com/dart-lang/sdk/issues/60635

DiagnosticSeverity is the new name for ErrorSeverity.

Change-Id: I9d1040f23d4fe8affb234ff62527133e439adf50
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/426341
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-05-03 17:14:04 -07:00
Robert Nystrom 11b81715ad Reformat runtime/ using the 3.8 formatter style.
Change-Id: I7b5e5dd768c87f28848ee02050582d23f3604cb1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/426286
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
2025-05-03 12:54:15 -07:00
Brian Wilkerson f01486a8e4 Improve the offset, length, and end getters in AstNodeImpl
While this does improve the performance of these getters (by about 5%)
the purpose of this CL is just to clean up the implementation of them.
It bothers my that they (especially `end`) are using such an indirect
way of computing their values.

Change-Id: I384890a9adc108c4c67b906864201edee9aa8598
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/426400
Auto-Submit: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2025-05-03 12:00:29 -07:00
Robert Nystrom ba40d9bece Format tests/web/ using the 3.8 formatting style.
Change-Id: I73edeeaf4934899b71d6335dcb4b4b54dce46bae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/426340
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2025-05-02 20:17:11 -07:00
Nicholas Shahan b03f3b7b8d [ddc] Reland refactor visitInstanceGetterInvocation()
Moves the remaining special case logic out of `_emitMethodCall()`
simplifying the reasoning about where so hot reload soundness checks
can be added.

The original change exposed a latent soundness bug that allowed for
some dynamic getter invocations to be performed without runtime checks.

This reland adds adds a note about the newly enforced runtime checks to
the CHANGELOG.

Change-Id: I387438b8615e60f73dfc5e3b883b8c6d5a9993da
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/425942
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
2025-05-02 16:57:28 -07:00
Nicholas Shahan 010a4b8227 [tests] Add regression test for dartbug.com/60643
Change-Id: I71d506e8cb7708478466b2162ccc40f0682f308c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/425941
Reviewed-by: Mark Zhou <markzipan@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2025-05-02 16:57:28 -07:00
Nicholas Shahan d791aa29fb [tests] Fix bad merge
Two changes landed that touched this test and they didn't merge cleanly.

Change-Id: Ie199dcb30b63627164ce2213fe4d61e65d664371
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/426285
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2025-05-02 16:04:50 -07:00
Srujan Gaddam 6b474e07be [dart:js_interop] Update jsify and dartify docs to be more accurate
https://github.com/dart-lang/sdk/issues/55222

It is quite confusing what these methods do or are supposed
to do. While we want to update the implementation, we should
instruct users what to expect for now.

CoreLibraryReviewExempt: Doc-only change.
Change-Id: I9b49d135f7c252659d2c52a0fb314a37251a9ac9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/425186
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2025-05-02 16:00:57 -07:00
FMorschel 576668104d [DAS] Adds test for renaming parameter parameter name
Fixes: https://github.com/dart-lang/sdk/issues/60578
Change-Id: Ie940bebc36e6d37875d7972df56d4c673747df60
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/423660
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Auto-Submit: Felipe Morschel <git@fmorschel.dev>
2025-05-02 15:01:04 -07:00
MarkZ 028914a3ef [ddc] Emitting embedder link functions via symbol property.
Fixes errors when top level 'link' members exist.

Change-Id: I0a339298ff9f51f6cd1f6af7c983eeda4a013956
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/426002
Commit-Queue: Mark Zhou <markzipan@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2025-05-02 15:00:17 -07:00
FMorschel 9cdfab07ec [DAS] Adds fix to use_if_null_to_convert_nulls_to_bools
Fixes: https://github.com/dart-lang/sdk/issues/47436
Change-Id: Idcdca7389a771d8ecee5c4746a37324cc5d96261
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/421889
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Auto-Submit: Felipe Morschel <git@fmorschel.dev>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2025-05-02 14:52:48 -07:00
FMorschel 95741cdc4f [DAS] Adds new fix to prefer_foreach lint
Fixes: https://github.com/dart-lang/sdk/issues/56995
Change-Id: Idc3788de241e27a568c1a0c2a26a0ce8f70fee62
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/422160
Auto-Submit: Felipe Morschel <git@fmorschel.dev>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-05-02 14:52:13 -07:00
Sam Rawlins b6508124a4 linter: add unnecessary_unawaited lint rule
Work towards https://github.com/dart-lang/sdk/issues/46218

Change-Id: I0c6953463d053205cc1110f554578e6b85eac0db
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/426240
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-05-02 14:36:20 -07:00
Nicholas Shahan b97f723c45 [ddc] Improve NoSuchMethod error for closures
Changes the text from "NoSuchMethodError: ''" to
"NoSuchMethodError: '<anonymous closure>'" for some failed invocations.

Adds more test cases involving getter and field invocations.

Change-Id: I685772fc69c7216ae67ea2535de38c8b925c0809
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/425940
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
2025-05-02 14:27:53 -07:00
Sam Rawlins fafad4e03d analyzer: Move the API tool so that it can generate API for other packages
Also, add some scripts to generate the analyzer_testing API, and checkin
the api.txt file for analyzer_testing.

In order to avoid a private analyzer import, I add `isExperimental` and
`hasExperimental` support for `@experimental` annotation, and switch
to using public APIs in `_dumpElement`.

Change-Id: I44319270d4e6083b80973b45933268c472876232
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/426282
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2025-05-02 14:22:31 -07:00
Konstantin Shcheglov 86e8e24017 Elements. Write directives text.
Change-Id: I5f7a0f039c2118f943c72b541b1571139695caf5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/425983
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-05-02 14:16:52 -07:00
Konstantin Shcheglov 24261bd5b5 Look into the interface for a getter / setter only if necessary.
Change-Id: Id586108c8dcd55180b87519565cfc7f9ddf258cf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/426280
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2025-05-02 14:14:28 -07:00
Nicholas Shahan 6127d6cb8f [ddc] Add checks to static invocations in closures
Previously, code in a closure was compiled with the assumption that
invocations known to be statically sound didn't need any runtime checks
to guaranty soundness.

Now, if the code is retained from an earlier compile and executed after
a hot reload, any assumptions regarding soundness may be invalid.

This change transforms what was an invocation expression into a larger
expression that performs additional checks (similar to a dynamic call).

All checks are skipped if the compile generation matches the current hot
reload generation at runtime.

The soundness checks are handled by a new runtime helper method
`hotReloadCorrectnessChecks`. Any argument expressions are hoisted into
let variables to preserve their evaluation order and to ensure they are
only evaluated once. The helper checks for the existence of the
invocation target, the shape of the method signature, and runtime type
of the passed arguments. Mismatches result in an invocation of
`NoSuchMethod`. Any returned value is cast to the expected static type
of the original invocation.

Change-Id: If925f1a9b475d5ac581b2526403ab7c95753ffef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/421640
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2025-05-02 12:52:05 -07:00
FMorschel a26d653b9f [DAS] Fixes keywords suggestion for patterns
Bug: https://github.com/dart-lang/sdk/issues/59854
Change-Id: I4e3b3ca51e08ea63e9516d6b1fca88f75895ade6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/417143
Auto-Submit: Felipe Morschel <git@fmorschel.dev>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2025-05-02 11:56:21 -07:00
Sam Rawlins 060e4e208c dartdev: Support running the AOT analyis_server snapshot for analyze command
The `dart analyze` command is quite separate from the `dart language-server` command. This CL adds support for `dart analyze`.

Work towards https://github.com/dart-lang/sdk/issues/50498

Change-Id: I60a846ae5d3452c2bb050bd07502084ff44b82c0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/425188
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2025-05-02 11:49:21 -07:00
Kallen Tu d7b3562cf4 [analyzer] Dot shorthands: FunctionReferences have dot shorthand flag.
`FunctionReference`s like `.foo<T>` can also be dot shorthands. This CL adds the flag onto that AST.

Unit test added and co19 tests that have function references are now passing.

Bug: https://github.com/dart-lang/sdk/issues/59835
Change-Id: I8c85e7915b665de5c4de2b249b22c6e8d8fc364d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/426001
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2025-05-02 11:07:31 -07:00
Sam Rawlins 57bfb6abd6 analyzer: Use new DiagnosticCode name in some directories
Work towards https://github.com/dart-lang/sdk/issues/60635

Change-Id: I942e690ab2946c564c10df228d17bd44de4ed375
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/425406
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2025-05-02 11:02:20 -07:00
Mayank Patke c56a8be4e5 [dart2wasm] Replace "dynamic module" with "submodule" where appropriate.
Change-Id: I4e51e10928ccc26c18f2a63f6cb6b23cd618d853
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/426003
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Ömer Ağacan <omersa@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
2025-05-02 10:15:40 -07:00
Mayank Patke 9ece92ed0f [dart2wasm] Enable dynamic module validation.
This change requires some modifications to the dart2wasm flags for
dynamic module support. Previously, we determined that dynamic module
support was needed if `--dynamic-main-module` was passed. We determined
that the main module was being compiled if `--dynamic-interface-uri` was
also passed, and a submodule (AKA "dynamic module") otherwise. This
design prevented us from passing the interface specification to the
dynamic module validator when submodules were being compiled.

Instead, we now build with dynamic support when the
`--dynamic-module-type` flag is passed. Allowable values are `main` and
`submodule`. Both the main module URI and interface URI are currently
required for both dynamic module types. (The main module URI could be
made optional if we generated a default filename like we do for dynamic
module metadata.)

Dynamic interface validation is enabled by default and is controlled by
the `--validate-dynamic-modules` flag. This flag can be negated via
`--validate-dynamic-modules=false` or `--no-validate-dynamic-modules`.

Change-Id: I3165c3a8255205a61c3ccfe546f5d436472ed0d9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/425154
Reviewed-by: Nate Biggs <natebiggs@google.com>
Reviewed-by: Ömer Ağacan <omersa@google.com>
2025-05-02 10:15:40 -07:00
Konstantin Shcheglov a0a6fc1c32 Elements. Move flags into MetadataImpl.
Change-Id: I4086f4155471387133feaa357710c0bd3d7f19a4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/425961
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2025-05-02 10:07:40 -07:00
DEPS Autoroller 9cbfabf9b1 Roll BoringSSL from 34492c89a8e3 to a70ec8dd2cc1 (6 revisions)
https://boringssl.googlesource.com/boringssl.git/+log/34492c89a8e3..a70ec8dd2cc1

2025-04-29 davidben@google.com Remove STACK_OF(CRYPTO_EX_DATA_FUNCS)
2025-04-29 davidben@google.com Remove STACK_OF(BIGNUM) from BN_CTX
2025-04-29 davidben@google.com Don't define N in hrss/internal.h
2025-04-28 davidben@google.com Add front(), back(), and pop_back() to internal containers
2025-04-28 davidben@google.com Move most of libssl's C++ utilities to libcrypto
2025-04-28 pcc@google.com Disable CFI in FIPS module

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/boringssl-dart-sdk
Please CC dart-engprod@google.com,dart-vm-gardener@grotations.appspotmail.com,dart-vm-team@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in BoringSSL: https://crbug.com/boringssl/new
To file a bug in Dart SDK: https://github.com/dart-lang/sdk/issues

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md

Tbr: dart-vm-gardener@grotations.appspotmail.com
Change-Id: Idbf311dc0bbe7a401fe0b271feb1ad39794836db
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/425640
Commit-Queue: Brian Quinlan <bquinlan@google.com>
Reviewed-by: Brian Quinlan <bquinlan@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2025-05-02 09:58:12 -07:00
Devon Carew 782a997c20 [deps] rev i18n, test, tools, web
Revisions updated by `dart tools/rev_sdk_deps.dart`.

i18n (https://github.com/dart-lang/i18n/compare/de19436..e44af54):
  e44af54  2025-05-01  dependabot[bot]  Bump the github-actions group with 2 updates (dart-lang/i18n#966)

test (https://github.com/dart-lang/test/compare/3ac991f..c3755d8):
  c3755d80  2025-05-01  dependabot[bot]  Bump github/codeql-action from 3.28.13 to 3.28.16 in the github-actions group (dart-lang/test#2492)
  935b8b04  2025-04-28  Danny Tuppeny  Allow specifying an explicit location for test/groups (dart-lang/test#2481)

tools (https://github.com/dart-lang/tools/compare/11f4cf7..92f10a9):
  92f10a9a  2025-04-30  Liam Appelbe  [coverage] Fix resume after shutdown error (dart-lang/tools#2079)
  7e8cb037  2025-04-29  Viral Verma  Add --fail-under flag for minimum coverage threshold (dart-lang/tools#2075)

web (https://github.com/dart-lang/web/compare/553c14d..f1becf0):
  f1becf0  2025-04-30  Natalie Weizenbaum  Add conversions between Dart's Uri and the JS URL (dart-lang/web#365)

Change-Id: Icc33983c9cc2cdad7add25494c92a21e8605b2a1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/425900
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2025-05-02 09:31:22 -07:00
Kallen Tu 73d6821a81 [analyzer] Dot shorthands: Report error when type arguments are not assignable.
This is a bug fix of the current implementation of dot shorthands type argument resolution. We want to make sure we're doing inference with the proper context type given at that point (with the element based on the dot shorthand context type we've saved).

Then I made sure there was proper argument checking, not just for `FunctionExpressionInvocation`s, but with `DotShorthandInvocation`s as well.

Tested with unit tests and language tests.

Bug: https://github.com/dart-lang/sdk/issues/59835
Change-Id: I795046502214628389c6471e9424aca7152657e2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/425780
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2025-05-02 09:28:52 -07:00
Sam Rawlins 4ef2725654 Add an analyzer_testing package
We intend to publish and maintain this as a set of testing-related
utilities for the analyzer packages and for analyzer plugins.

Work towards https://github.com/dart-lang/sdk/issues/55660

See the doc: https://docs.google.com/document/d/1jRtd8B1ijPAP6Pz89HRnyIZXw2VMjaZx0vRZTpoNO84/edit?tab=t.0#heading=h.2sz41a544qhi

Change-Id: I2764b1357a932fa955060b26d78038997eaa9536
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/425080
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2025-05-02 06:58:49 -07:00
Robert Nystrom c9d54c12f6 Reformat tests/language/s** using 3.8 style.
Change-Id: I3c5cfbc1bc5e41d2ef1598427067dea00f9f42b4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/425403
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
2025-05-02 04:46:00 -07:00
Robert Nystrom 200e0c83bd Reformat tests/language/r** using the 3.8 style.
Change-Id: Ibfa8df8eb3cdeec9afd45fa8448a7186869ae2c4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/425345
Reviewed-by: Lasse Nielsen <lrn@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
2025-05-02 04:45:20 -07:00
Robert Nystrom 1ba6da2d08 Reformat tests/language/t** using 3.8 style.
Change-Id: I9627ebe0aa4d51d053a8dd1bd85873ba72e8e03c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/425325
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
2025-05-02 04:28:39 -07:00
Robert Nystrom cf4813a6cc Reformat tests/language/u** using 3.8 style.
Change-Id: I0618aa2abf0cd541dad70a77430a2745340f485a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/425405
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
2025-05-02 04:26:26 -07:00
Robert Nystrom 33798260d6 Reformat tests/language/v-z* using 3.8 style.
Change-Id: I781aabc6acc4f0341659380ed6cd169d66edce4e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/425346
Commit-Queue: Lasse Nielsen <lrn@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
2025-05-02 04:14:03 -07:00
Robert Nystrom d3904f5a54 Reformat tests/lib/async/** using 3.8 style.
Change-Id: I6ccbe1494165c2bda142ece13584c4738e3b43e6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/425347
Commit-Queue: Lasse Nielsen <lrn@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
2025-05-02 04:08:54 -07:00