Commit graph

92989 commits

Author SHA1 Message Date
Robert Nystrom d6b9e42f2e Update CHANGELOG to clarify there are no language changes.
Change-Id: I4a722ab4b78ffcc751d04e0b06ba879093ee6b02
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/318749
Commit-Queue: Leaf Petersen <leafp@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
2023-08-07 23:33:45 +00:00
Konstantin Shcheglov 7d83540366 Extension types. Report an error for instance fields in extension types.
Change-Id: I35cb446c45e027a77d0a5ff870b4e5b4b22b7512
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/318747
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-08-07 22:39:55 +00:00
Konstantin Shcheglov b4164b956f Extension types. Test for invoking (old) extension methods on extension types.
Change-Id: I7da853dbfa4b24b578ba1eb1a9999e8582c63016
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/318748
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-08-07 22:04:19 +00:00
Konstantin Shcheglov 33736cab48 Extension types. Report when used in extends, implements, with, on clauses.
Change-Id: I84effd787ce6405140beae13662f3255fd929012
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/318744
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-08-07 21:00:04 +00:00
Devon Carew 1b1c62a5b8 [deps] rev ecosystem, http, mockito, native, protobuf, shelf, sse, test, tools
Revisions updated by `dart tools/rev_sdk_deps.dart`.

ecosystem (97fc1a7..dfeda1a):
  dfeda1a  2023-08-01  dependabot[bot]  Bump actions/labeler from 4.0.4 to 4.3.0 (#148)
  c341051  2023-08-01  dependabot[bot]  Bump coverallsapp/github-action from 2.2.0 to 2.2.1 (#147)
  c1c8d1f  2023-08-01  Moritz  Update health.yaml (#146)
  31c5d21  2023-07-27  Devon Carew  misc updates to the label management tool (#145)

http (4289e8b..7e9ed12):
  7e9ed12  2023-08-01  dependabot[bot]  Bump actions/labeler from 4.2.0 to 4.3.0 (#1000)
  e8e35db  2023-07-31  Alex James  [java_http] send request body (#995)

mockito (b421775..ff79de6):
  ff79de6  2023-08-04  Nate Bosch  Allow the latest package:analyzer

native (f0dc3e9..0187d0e):
  0187d0e  2023-08-07  Daco Harkes  [native_assets_cli] Rename `Asset` `name` to `id` (#113)
  1b984c7  2023-08-07  Daco Harkes  [native_assets_cli] Replace `TypeError`s with `FormatException`s (#112)
  b2b26db  2023-08-07  Daco Harkes  [native_assets_builder] Stop throwing from BuildRunner (#108)
  c940ac8  2023-08-03  Daco Harkes  [native_assets_builder] return build dependencies (#107)
  63daab8  2023-08-03  Daco Harkes  [native_assets_builder] Fix dry run directory structure (#110)
  3f26f20  2023-08-01  dependabot[bot]  Bump coverallsapp/github-action from 2.2.0 to 2.2.1 (#104)

protobuf (d9e8a31..217c030):
  217c030  2023-08-02  Ömer Sinan Ağacan  Avoid holding onto the buffer when parsing unknown length-delimited fields (#863)

shelf (bd59ead..73edd2b):
  73edd2b  2023-08-01  dependabot[bot]  Bump actions/labeler from 4.2.0 to 4.3.0 (#370)

sse (e241085..8cc5b11):
  8cc5b11  2023-08-01  dependabot[bot]  Bump nanasess/setup-chromedriver from 2.0.0 to 2.1.1 (#86)

test (92eb0f7..5d571d6):
  5d571d64  2023-08-03  Nate Bosch  Add --fail-fast flag (#2040)
  a9dcce29  2023-08-01  Nate Bosch  Rerun publish workflow on more PR changes (#2070)
  50d558b2  2023-08-01  dependabot[bot]  Bump github/codeql-action from 2.20.1 to 2.21.2 (#2071)
  9e124e9f  2023-07-31  Nate Bosch  Prepare to publish (#2069)

tools (af3fc99..f14bf2e):
  f14bf2e  2023-08-07  Elias Yishak  Remove unused NoOp classes (#138)
  a2aa1c3  2023-08-07  Devon Carew  add CI; update readme (#140)
  d424568  2023-08-06  Devon Carew  add usage docs to package:cli_config (#141)
  921611a  2023-08-03  Elias Yishak  Survey handler feature (#109)

Change-Id: Iee720272733822d11caf46adcae516f12f11abec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/318801
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Auto-Submit: Devon Carew <devoncarew@google.com>
2023-08-07 18:16:46 +00:00
Danny Tuppeny 2a811a0ad9 [analysis_server] Split DartUnitHoverComputer.compute() into smaller methods
No functional changes here, I'm just trying to simplify the hover implementation a little as this method had gotten quite long and deeply nested. We've discussed improving hover support for patterns and keywords and hopefully this'll make that easier.

Change-Id: I974f7fb0fbb99a967b5970f99b36ef3601df4ea3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/318701
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-08-07 18:14:15 +00:00
Konstantin Shcheglov 0e32c36019 Extension types. Tests for InstanceCreationExpression.
Change-Id: I50e7cfa4cb574c7626a7a3ae0990edcb8e32b37f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/318743
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-08-07 18:08:43 +00:00
Konstantin Shcheglov 0cd0412a75 Extension types. Report when invalid type is implemented.
Change-Id: I66c30209a5fe5083f78291ea3ec7e5fd2259164f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/318742
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-08-07 18:06:11 +00:00
Kallen Tu 848638c47b [analyzer] Add test for enum equality in constant evaluation.
Confirm that const enum equality works with the addition of enum comparisons in recent language changes like https://github.com/dart-lang/language/issues/312

We can keep an extra test in the suite.

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

Bug: https://github.com/dart-lang/sdk/issues/45441
Change-Id: I80f7496e172a9a09e9bec3ea1643811788b38443
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/316701
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-08-07 18:00:39 +00:00
Ryan Macnak 6d4573aced [test] Skip high-memory tests on Linux ARM64.
Bug: https://github.com/dart-lang/sdk/issues/52589
Bug: https://github.com/dart-lang/sdk/issues/53138
Change-Id: Iaf6e499d80726b5ec8a810a5d3bd1d90a0d93af9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/318800
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2023-08-07 17:58:07 +00:00
Joshua Litt 0332c70638 [wasm_builder] Lift import / definition restrictions.
Change-Id: Id0651e8e2ad270be5cc3788d361257769088faa6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/316627
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2023-08-07 17:08:13 +00:00
pq 4e6ed304f1 fix @override description typo
Change-Id: I52df1ae27774ce1880c3ef2f53dbb5335a4cda01
CoreLibraryReviewExempt: typo fix (no semantic changes)
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/318780
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Marya Belanger <mbelanger@google.com>
2023-08-07 17:00:48 +00:00
Keerti Parthasarathy 360ebb6e50 Wire up a parse option for bulk processor
Change-Id: I8cecd6bf4ac3693e2cf65a66eed809abb571b22a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/318362
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2023-08-07 16:29:58 +00:00
Konstantin Shcheglov 6ac57ff0b9 Extension types. Report when a method has the name of an Object member.
Change-Id: I0585451580c1a1921f813a1af574175f04354475
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/318741
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2023-08-07 16:11:59 +00:00
Brian Wilkerson 7901efffe7 Convert a few more methods in KeywordContributor
Change-Id: I905a4855f67db227ab654c3d4dc7441b7ee2bf58
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/315540
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2023-08-07 16:09:40 +00:00
Danny Tuppeny 17f3a6ec30 [analysis_server] Convert more LSP handlers to work over the legacy protocol
Change-Id: I9bd1f3ffd9bcdb017a4208e4aedcfb7436259fc8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/318700
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-08-07 15:27:46 +00:00
Keerti Parthasarathy 2530047ad2 Add test case for #53101
Change-Id: I0d6956e37e4240f861addf7c71a933071c1498b6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/318022
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2023-08-07 14:55:14 +00:00
Danny Tuppeny 660c9bbace [analysis_server] Switch LSP completion tests to use new setXxx() capabilities instead of nested withXxxx() capabilities methods
No functional changes, just simplifies the tests a little by calling functions to set capabilities instead of having to nest them inside `initialize()` calls.

Change-Id: I1496da221b1802c3375c32c7e0d048310769bdf9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/317961
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-08-07 14:39:32 +00:00
Danny Tuppeny ea5e58356b [analysis_server] Fix logging of LSP-over-Legacy requests to use the LSP identifiers
Otherwise they'll be recorded as "lsp.handle".

Change-Id: I511d5eef44d6d647fef4d0347a03f6a7a9f88f9e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/315920
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-08-07 14:27:12 +00:00
Paul Berry 13f4d956f7 SDK: take advantage of field promotion.
Now that field promotion (language feature `inference-update-2`) has
been enabled, we can take advantage of it in the core SDK.

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

Change-Id: I7144ec26a7b4428f758f4d876d0fdce54a4e30ee
Bug: https://github.com/dart-lang/sdk/issues/52982
CoreLibraryReviewExempt: VM-only change
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/314640
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2023-08-07 14:20:41 +00:00
Johnni Winther 7a2f49a3fa [cfe] Check cyclic representation dependency
Change-Id: Ic0da6d4af5c16c1460add140bbffcb21c5a2139d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/318280
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-08-07 08:58:28 +00:00
Alexander Thomas 161a698f7f [infra] Fix chromedriver packaging issue
Change-Id: I697bda0006cca5785694156d7cd84efcd008b545
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/318340
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2023-08-07 07:55:19 +00:00
Martin Kustermann 8acd7d4dba [gardening] Exclude vm/cc/ManyClasses test from running under TSAN
The test generates many classes, compiles a lot of code and executs very
large function.

This is too slow under TSAN

TEST=Skip vm/cc/ManyClasses on TSAN

Change-Id: I867fe9c1d50e7e976cd0a58659464c3eada5e56c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/318640
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2023-08-07 07:44:37 +00:00
Danny Tuppeny 16d787694a [analysis_server] Refactor completion labels in preparation for new LabelDetails support
This is just a little refactoring towards https://github.com/Dart-Code/Dart-Code/issues/2462. It doesn't change anything, it just makes the next CL (with the functional changes) simpler.

Change-Id: I98ed5991f1abb67f86f9d4d43c27ff6ccf21847c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/317940
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-08-06 18:21:31 +00:00
Danny Tuppeny 7f0ac7853e [analysis_server] Fix navigation for the offset between a type name and generic type args
Fixes https://github.com/Dart-Code/Dart-Code/issues/4619

Change-Id: I5cee17037fe4531183dc5e2cb566e9f020e1b541
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/316223
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-08-06 17:37:27 +00:00
Danny Tuppeny 76dc2c4cfa [analysis_server] Change LSP-over-Legacy to be wrapped with the original protocol
Originally we didn't use the LSP Request/Response classes, and just exposed the handlers through the legacy request/response.

However there were some mismatches (such as legacy protocol always returns Map<String, Object?> but some LSP requests return Lists, LSP using int|String IDs, and LSP having numeric error codes that don't match legacy string error codes).

This change uses LSP's request and Response by wrapping them inside a standard (legacy) handler. The LSP-over-Legacy handler has become a standard handler, and the params contain an "lspMessage" field that holds an LSP message, and the result contains an "lspResponse" field that contains an LSP response.

If an LSP handler returns an error, it will be returned as an error inside the LSP response, which will be in a _successful_ legacy request (since that's how we can return an LSP response - as the result).

Change-Id: I67973590ab32f3543d1a6e1b7279974e5e8832bc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/315201
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-08-06 14:32:18 +00:00
Danny Tuppeny 678e207a6d [analysis_server] Fix a bug with sorting semantic tokens
I was trying out DCM and it found this bogus condition.

The only instance I can find where it triggered was adjacent interpolations in strings, and the fallback code (which compares by token type) would handle it correctly, but in case there are other cases (now or in future), I've added an assert to try to avoid reaching the fallback in case it doesn't produce the desired result.

Change-Id: I3092fa4892c812be7d3a91629c5f6ed3be627743
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/315720
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-08-05 19:05:38 +00:00
Konstantin Shcheglov e21306a4eb Extension types. Report when a type parameter is used in a non-covariant position.
Change-Id: I12dbfccdf670cb02f74ddcb787b9e1e4a2b4e6fb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/318001
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-08-05 03:51:42 +00:00
Konstantin Shcheglov 26325d6f29 Extension types. Report conflicts.
Change-Id: I389561c2a143600968ed85cc3fd86ac1d81d649b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/318480
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-08-05 03:49:38 +00:00
Konstantin Shcheglov 319eb24e1e Prepare to publish analyzer 6.1.0 and _fe_analyzer_shared 63.0.0
Bug: https://github.com/dart-lang/sdk/issues/53084
Change-Id: Id3143e4d2ffd7795a5c36c69d1e6c62d4ee7c65c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/318460
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2023-08-04 22:34:59 +00:00
Srujan Gaddam a56642e9a1 [dart:js_util] Handle type parameters in export/mocks.
Several changes are made:

- createDartExport now does not export methods that define type parameters.
- createStaticInteropMock adds conformance checks to make sure implementing
members can handle all possible values of a type parameter in an interop
member. An error is added to reduce confusion around this.
- Export creator now uses dart:js_interop_unsafe for a lot of its lowering
as the dart:js_util equivalents are buggy when it comes to calling exported
functions in JS with JS types.
- Small code changes are added to backends to handle the above changes.

Change-Id: Ie3b6b157930537267f270b60373b2b17e0a14344
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/316141
Reviewed-by: Joshua Litt <joshualitt@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2023-08-04 21:45:29 +00:00
Konstantin Shcheglov b9a66a0d2e Extension types. Report an error if the feature is not enabled.
Change-Id: Icc1e4fddea91dab22fcab694928c9138b0781e76
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/318440
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-08-04 21:10:39 +00:00
Konstantin Shcheglov 8cb82a35e8 Expose greatestLowerBound() from TypeSystem.
Bug: https://github.com/dart-lang/sdk/issues/53042
Change-Id: Ib332a7ab005a432d98066d79c2e48a5f06e88716
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/318000
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-08-04 20:47:46 +00:00
Konstantin Shcheglov 2edf0d3720 Extension types. Tests for resolving NamedType.
Change-Id: I80557d8a147e3de450a13e43ca3bd1eed9960b9d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/318023
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-08-04 20:40:33 +00:00
Kallen Tu 7e04cd002b [analyzer] Fix file paths in const tests.
Change-Id: I4b3ae8a5aad0b019640c46205364857942db2d92
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/318400
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2023-08-04 19:48:47 +00:00
Parker Lougheed 99745598cd Update old linter site links to dart.dev
Bug: https://github.com/dart-lang/linter/issues/4460 and https://github.com/dart-lang/site-www/issues/4499
Change-Id: Ieb90512aac4e476b922765c6ee191085a2ad2c9b
CoreLibraryReviewExempt: Only updates a link in documentation comments.
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311880
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2023-08-04 19:45:23 +00:00
Konstantin Shcheglov 508a293029 Revert a few not published API changes.
Change-Id: I093c3d3f6e221cfe874e82b598f52087670ce24e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/318020
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-08-04 19:21:58 +00:00
Konstantin Shcheglov 759d5a5a01 Extension types. Report when await of not Future subtype.
Change-Id: I51b825c1d48b55866d8112ab6421c7937a0c7575
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/318024
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-08-04 19:18:11 +00:00
Konstantin Shcheglov ce7164488a Extension types. Semantic highlighting.
Change-Id: I46cde8151965e209a230df811592f8498e93c218
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/318161
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-08-04 19:13:43 +00:00
Kallen Tu 944a2f691e [analyzer] Make constant assertion errors more helpful and specific.
If a condition is valid, but fails in an assert, make sure we report
that and a pseudo trace with context messages for the user to link
back to the problem.

This CL also starts building the stack trace when we call a super constructor for more detailed errors.

Bug: https://github.com/dart-lang/sdk/issues/36526
Change-Id: Ib9bc9841256644d2380d3f806e3bc3c9d84b37cf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/316625
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2023-08-04 17:33:58 +00:00
Anna Gringauze dd1e7ae18b [ddc] Run tests on canary and stable bots with matching settings
Closes: https://github.com/dart-lang/sdk/issues/53077
Towards: https://github.com/dart-lang/sdk/issues/43986
Change-Id: I60df13b8ff29a0865a45b3a48a97af0ce94460b7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/317448
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Anna Gringauze <annagrin@google.com>
2023-08-04 15:22:38 +00:00
Derek Xu d0114ec0a2 [dart:developer] Add static Service.getObjectId method
TEST=pkg/vm_service/test/developer_service_get_object_id_test.dart

Fixes: https://github.com/dart-lang/sdk/issues/53012
Change-Id: I4b4dd49363ff2d91361e9054631516ea1520d3b6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/317160
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2023-08-04 14:18:38 +00:00
Derek Xu 0d16e25c6c [dart:developer] Deprecate Service.getIsolateID in favour of Service.getIsolateId
TEST=CI

CoreLibraryReviewExempt: This CL just marks Service.getIsolateID as
deprecated in favour of Service.getIsolateId, which is identical in all
aspects other than the name. We agreed that the new name was better here:
https://dart-review.googlesource.com/c/sdk/+/317160/comment/032739dd_b5e6abc1/
Change-Id: I1464ff3ce7430f01dfeeaf95f56ec980561efd21
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/317220
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-08-04 14:18:38 +00:00
Ömer Sinan Ağacan 28453a6255 [dart2wasm] Handle unchecked as expressions
Fixes #53104.

Change-Id: I8a1a47775226f73445551ca4bd9f471c8dedfe93
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/318220
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
Auto-Submit: Ömer Ağacan <omersa@google.com>
2023-08-04 14:06:49 +00:00
Martin Kustermann 21d8e30728 [vm] Cleanup kernel loader code
After simplifying the handling of annotations in the kernel loader in
[0] we no longer need to use handle-based access to pragmas.

Also use bit field to represent detected pragmas.

[0] https://dart-review.googlesource.com/c/sdk/+/290502

TEST=ci

Change-Id: I2e21c9e96accce1580964e617f05e4316563b463
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/318260
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2023-08-04 13:40:32 +00:00
Johnni Winther 235aed1208 [cfe] Avoid crash on pattern switch statement in constant evaluator
In response to https://github.com/dart-lang/sdk/issues/53111

Change-Id: I4403b2c92fe983fcfc6d5cd8542c58d9468b5b26
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/317884
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-08-04 13:09:37 +00:00
Martin Kustermann 587e6308bf [vm] Fix expression evaluation in context of closures
When evaluating an expressino at a breakpoint that's inside a closure,
the closure may refer to anything it closes over. That includes the
`this` from an enclosing method.

So depending on whether a closure's parent chain is an instance method
or a static method, the expression evaluation function is going to be an
instance method or a static method.

=> We walk up the parent chain to determine the correct enclosing class.
=> This avoids making a Type object with a cid from a top-level class (see [0])

Handling this correctly will now try to get the `this` when invoking an
eval function that has an enclosing instance method. Though we may often
have "<optimized out>" the `this` (e.g. due to not capturing it in
closure context chain).

=> We still allow running the expression evaluation function in this
case, but only if the expression being evaluated doesn't access `this`.

A similar issue occurs when trying to use variables in the eval
expression that the closure didn't capture. This results in a confusing
CFE compile-time error. This is a separate issue and tracked in [1].

=> We update the test to distinuish the cases that this CL makes passing
and those that are failing due to [1].

Fixes [0] https://github.com/dart-lang/sdk/issues/53061
See also [1] https://github.com/dart-lang/sdk/issues/53087

TEST=Fixes part of service/evaluate_activation_test failures

Change-Id: I3bb24e7338c7b2f12d5340311d944cb59a455641
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/317540
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2023-08-04 11:07:46 +00:00
Sergey G. Grekhov dcf4fd7055 [co19] Roll co19 to bbb3feb38db0a9c4489736229ea9b06215a1706b
2023-08-03 sgrekhov22@gmail.com dart-lang/co19#2142. Rename and move static analysis extension type tests (dart-lang/co19#2164)
2023-08-03 sgrekhov22@gmail.com dart-lang/co19#2142. Add more static analysis inline class tests (dart-lang/co19#2163)
2023-08-02 sgrekhov22@gmail.com dart-lang/co19#2142. Turn static analysis inline classes tests to extension type tests. Part 2 (dart-lang/co19#2161)
2023-08-02 sgrekhov22@gmail.com dart-lang/co19#2142. Move dynamic semantics member invocation tests to Extension-types folder (dart-lang/co19#2156)
2023-08-02 sgrekhov22@gmail.com dart-lang/co19#2142. Change static analysis inline class tests to be extension type tests. Part 1 (dart-lang/co19#2157)
2023-08-01 49699333+dependabot[bot]@users.noreply.github.com Bump actions/setup-java from 3.11.0 to 3.12.0 (dart-lang/co19#2160)
2023-07-28 sgrekhov22@gmail.com dart-lang/co19#2142. Change dynamic semantics member invocation tests to be extension type tests (dart-lang/co19#2154)

Change-Id: Icfb257200f9922971390c96bf8fb51093c4becfe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/318060
Reviewed-by: Alexander Thomas <athom@google.com>
2023-08-04 08:21:19 +00:00
Jens Johansen 918ef141e8 [CFE] Add weak suite semi fuzz failures to status file
Change-Id: I05a86222b40ea84e41f42dafab771eb24051e196
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/317941
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2023-08-04 06:41:38 +00:00
Nate Biggs 37fba7b9dc [dart2js] Add alias mapping for deferred import IDs.
Today the deferred import mapping is missing a way to match a specific user-defined deferred load alias to a corresponding runtime load ID. This adds a new field, "importPrefixToLoadId", under each library entry, which is keyed by library URI, which maps from the user-defined deferred load ID to the Dart2JS runtime load ID.

Example using https://github.com/dart-lang/sdk/blob/main/tests/language/deferred/split_constants_canonicalization_test.dart:
```
{
  "_comment": "This mapping shows which compiled `.js` files are needed for a given deferred library import.",
  "split_constants_canonicalization_test.dart": {
    "name": "<unnamed>",
    "imports": {
      "1": [
        "out.js_1.part.js"
      ],
      "4": [
        "out.js_2.part.js"
      ]
    },
    "importPrefixToLoadId": {
      "a": "1",
      "b": "4"
    }
  },
  "split_constants_canonicalization_a.dart": {
    "name": "<unnamed>",
    "imports": {
      "2": [
        "out.js_4.part.js",
        "out.js_3.part.js"
      ],
      "3": [
        "out.js_4.part.js",
        "out.js_5.part.js"
      ]
    },
    "importPrefixToLoadId": {
      "a_1": "2",
      "a_2": "3"
    }
  },
  "split_constants_canonicalization_b.dart": {
    "name": "<unnamed>",
    "imports": {
      "5": [
        "out.js_4.part.js",
        "out.js_6.part.js"
      ],
      "6": [
        "out.js_4.part.js",
        "out.js_7.part.js"
      ]
    },
    "importPrefixToLoadId": {
      "b_1": "5",
      "b_2": "6"
    }
  }
}
```

Change-Id: Ia6a6f8e45613c0081485e3fe5ddc84627749ee8e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/317222
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2023-08-03 22:13:40 +00:00