1
0
mirror of https://github.com/dart-lang/sdk synced 2024-07-01 07:14:29 +00:00
Commit Graph

1308 Commits

Author SHA1 Message Date
Srujan Gaddam
1c534e5fd5 [dart2wasm/ddc/dart2js] Lower Function.toJS and JSExportedDartFunction.toDart
Lowers these extension methods to some helper functions instead of
allowInterop to improve performance and get consistent semantics.

Specifically:
- Function.toJS no longer gives you the same JSFunction when calling
toJS on the same function multiple times in the JS compilers.
- Adds fast calling syntax for functions with 0-5 args in the JS
compilers.
- Allows additional args to be passed to converted functions that
are omitted in the JS compilers.
- The static type now determines the number of args that can be
passed to the JS function in the JS compilers.
- Fixes an issue in dart2wasm where if too few arguments are
passed, the call may succeed due to conversion of undefined to
null.
- Adds throws when a user tries to wrap a JS function that
returned from Function.toJS in the JS compilers.

Closes https://github.com/dart-lang/sdk/issues/55515
Addresses https://github.com/dart-lang/sdk/issues/48186

CoreLibraryReviewExempt: Changes to docs only in API surface.
Change-Id: I41d864dc5e02b597d9f1c16c88e3c04872f28225
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/368065
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2024-06-26 23:06:36 +00:00
Srujan Gaddam
b8402f5c27 [dart:js_interop] Make ExternalDartReference generic
Closes https://github.com/dart-lang/sdk/issues/55342
Closes https://github.com/dart-lang/sdk/issues/55536
Closes https://github.com/dart-lang/sdk/issues/56015

- Adds a type parameter T that extends Object? to
ExternalDartReference to capture the type of the value
that was externalized.
-- In the JS compilers, the representation type of
ExternalDartReference is now T.
-- In dart2wasm, the representation type is now JSValue?.
- ExternalDartReference no longer implements Object.
- Return type of toDartObject is now T.
- ObjectToExternalDartReference and
ExternalDartReferenceToObject both now are on a T that is
bound to Object?.
- Internal patches for WeakReference and Finalizer are
updated.

Change-Id: Ic2dc834b17ec6a4eb2122cba3c495a6e0a1eae6e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/370663
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
2024-06-26 21:53:53 +00:00
Kevin Moore
06a7c30b9d changelog: drop workspace reference from 3.5
Not ready to announce it (yet)

Change-Id: Icc7fbdaa2564511429a1b5601afcce065a5663f5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373162
Auto-Submit: Kevin Moore <kevmoo@google.com>
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
Reviewed-by: Sigurd Meldgaard <sigurdm@google.com>
2024-06-26 09:12:36 +00:00
Srujan Gaddam
1550539558 [dart:js_interop] Make not and isTruthy return JSBoolean
Since these operators can't be written by users, prefer
to keep them as JS types.

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

Change-Id: Ifb9b581fb82e057ba14c669a5a3934f9c502d06f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/359181
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2024-06-25 17:50:33 +00:00
Srujan Gaddam
0b761229cc [dart:js_interop] Change importModule to accept JSAny
Closes https://github.com/dart-lang/sdk/issues/55429
Closes https://github.com/dart-lang/sdk/issues/55508

Objects like TrustedScriptURLs can be passed to the dynamic import
function, and therefore importModule should accept any JS value.

Change-Id: I43ce9aeb1e8fbd628bc768a16b246ba19470b1dc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/363504
Reviewed-by: Lasse Nielsen <lrn@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2024-06-25 17:50:33 +00:00
Lasse R.H. Nielsen
705c745e19 Add @Since annotation, correct changelog entry position.
CoreLibraryReviewExempt: Trivial change.
Change-Id: I5c23641ed562efe51c0c7c35517ba75fffdd05ad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/372503
Reviewed-by: Kevin Moore <kevmoo@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
2024-06-20 15:35:56 +00:00
Lasse R.H. Nielsen
a505bbc6a0 Add TypedDataList superinterface on typed data lists.
Adds an interface which implements both `TypedData`
and `List`. That allows abstracting over types that are both
`List` and `TypedData` without losing access to one of the
interfaces.

Tested: typed_data_interface_test.dart
Change-Id: Idbdfc084ea5d2d9a072887973e2e9d29a5fd94ce
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371100
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2024-06-20 08:18:38 +00:00
Stephen Adams
18994e6e46 [typed_data] Remove UnmodifiableXXXView classes
In most cases, the (now removed) SDK class was patched so that the constructor redirected to a platform-specific implementation of the unmodifiable view. Uses of the SDK class in the platform code could be rewritten to the more direct use of the implementation class.

The big +/- file changes are from moving the implementation classes from the patch file (typed_data_patch.dart), where they are no longer needed, to the internal file (typed_data.dart).

TEST=ci
Bug: #53785
Change-Id: Iaa7370de25b7fc2d26b24f7733c2892868e593cb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/370661
Reviewed-by: Ömer Ağacan <omersa@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Brian Quinlan <bquinlan@google.com>
2024-06-13 22:18:29 +00:00
Daco Harkes
4b2906cdc1 [vm] Move ResolveUri to platform
This will enable the standalone embedder to resolve uris in a follow
up CL:
https://dart-review.googlesource.com/c/sdk/+/361881

The implementation was using zones for allocation, this CL switches
that to using `malloc`. The caller is responsible for freeing the
memory if resolving succeeds.

This CL removes `Dart_DefaultCanonicalizeUrl`.

We don't have a run_platform_tests, so this CL keeps the tests in
run_vm_tests.

TEST=vm/cc/ParseUri
TEST=vm/cc/ResolveUri
TEST=tests/ffi/native_assets/asset_relative_test.dart

Bug: https://github.com/dart-lang/sdk/issues/55523
Change-Id: Ifb300d8164eb50506f22ce619fad0811f74ef34c
Cq-Include-Trybots: luci.dart.try:vm-aot-asan-linux-release-x64-try,vm-aot-msan-linux-release-x64-try,vm-asan-linux-release-arm64-try,vm-asan-linux-release-x64-try,vm-msan-linux-release-arm64-try,vm-msan-linux-release-x64-try,pkg-linux-debug-try,pkg-linux-release-arm64-try,pkg-linux-release-try,pkg-mac-release-try,pkg-mac-release-arm64-try,pkg-win-release-arm64-try,pkg-win-release-try,vm-aot-linux-debug-x64-try,vm-linux-debug-x64-try,vm-reload-linux-debug-x64-try,vm-reload-rollback-linux-debug-x64-try,vm-aot-win-debug-x64-try,vm-win-debug-arm64-try,vm-mac-debug-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/368423
Reviewed-by: Martin Kustermann <kustermann@google.com>
2024-06-12 16:45:19 +00:00
Stephen Adams
20316bcc5b Reapply "[js_runtime, js_dev_runtime] Implement microsecond field of DataTime"
Original change: https://dart-review.googlesource.com/c/sdk/+/366963

This reverts commit 72b2883c6f.


[js_runtime, js_dev_runtime] Implement `microsecond` field of `DataTime`

- Move DateTime implementation for dart2js and DDC into a shared place to reduce duplication.

- Add a _microsecond field to the web DateTime to track microseconds outside of the JavaScript Date.

- The cute dart2js optimization whereby `DateTime.now().millisecondsSinceEpoch` is compiled to `Date.now()` still works.

- Both implementations report better errors.

- Fixed VM bug with in-range sentinel.


Issue: https://github.com/dart-lang/sdk/issues/44876
Issue: https://github.com/firebase/flutterfire/issues/12102
Issue: b/342552853
CoreLibraryReviewExempt: Reapply of unchanged code
Change-Id: I7f14b69e412a052ef3fe6b43cc9cf9d96319adb8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/368380
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
2024-05-31 15:42:14 +00:00
Sigurd Meldgaard
5ae66feaac Mention workspaces in CHANGELOG
Change-Id: I6c2fe0f87292402f5af1399fc6fb4706c32dead6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/368342
Reviewed-by: Sarah Zakarias <zarah@google.com>
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
2024-05-28 10:07:09 +00:00
Ivan Inozemtsev
72b2883c6f Revert "[js_runtime, js_dev_runtime] Implement microsecond field of DataTime"
This reverts commit fb057ea4e0.

Reason for revert: b/342552853

Original change's description:
> [js_runtime, js_dev_runtime] Implement `microsecond` field of `DataTime`
>
> - Move DateTime implementation for dart2js and DDC into a shared place to reduce duplication.
>
> - Add a _microsecond field to the web DateTime to track microseconds outside of the JavaScript Date.
>
> - The cute dart2js optimization whereby `DateTime.now().millisecondsSinceEpoch` is compiled to `Date.now()` still works.
>
> - Both implementations report better errors.
>
> - Fixed VM bug with in-range sentinel.
>
>
> Change-Id: I9156255bdb6ecc195500ae9bc88f91fb315b6297
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366963
> Reviewed-by: Alexander Aprelev <aam@google.com>
> Reviewed-by: Martin Kustermann <kustermann@google.com>
> Reviewed-by: Lasse Nielsen <lrn@google.com>
> Commit-Queue: Stephen Adams <sra@google.com>

Change-Id: I58572256a7710df4589bb5e41c7afee295c2388b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/368103
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Auto-Submit: Ivan Inozemtsev <iinozemtsev@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
2024-05-27 07:54:14 +00:00
Stephen Adams
fb057ea4e0 [js_runtime, js_dev_runtime] Implement microsecond field of DataTime
- Move DateTime implementation for dart2js and DDC into a shared place to reduce duplication.

- Add a _microsecond field to the web DateTime to track microseconds outside of the JavaScript Date.

- The cute dart2js optimization whereby `DateTime.now().millisecondsSinceEpoch` is compiled to `Date.now()` still works.

- Both implementations report better errors.

- Fixed VM bug with in-range sentinel.


Change-Id: I9156255bdb6ecc195500ae9bc88f91fb315b6297
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366963
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2024-05-22 05:18:52 +00:00
Parker Lougheed
10a38d0fd1 [linter] Update linter details for newest lints
Change-Id: If2ff9ea645c77cd4912f0bc6626468aa375b366e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366970
Auto-Submit: Parker Lougheed <parlough@gmail.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2024-05-20 15:03:46 +00:00
Sigurd Meldgaard
a42c38be4d Bump pub to e184bfc725793cbbf222fa8d8f96da10c40af24a
Changes:
```
> git log --format="%C(auto) %h %s" 55cc6c1..e184bfc
 https://dart.googlesource.com/pub.git/+/e184bfc7 Bump lints from 3.0.0 to 4.0.0 (4265)
 https://dart.googlesource.com/pub.git/+/e75f5c3c Clean up copy and formatting of unpack command help (4261)
 https://dart.googlesource.com/pub.git/+/8159633c Reapply binstub fix (4258)
 https://dart.googlesource.com/pub.git/+/342f6e22 Bump actions/checkout from 4.1.4 to 4.1.5 in the github-actions group (4264)
 https://dart.googlesource.com/pub.git/+/71130097 blast_repo fixes (4263)
 https://dart.googlesource.com/pub.git/+/4a44cfb6 Revert "Fix package name when refreshing binstubs (4205)" (4255)
 https://dart.googlesource.com/pub.git/+/4220a750 Bump actions/checkout from 4.1.2 to 4.1.4 (4253)
 https://dart.googlesource.com/pub.git/+/6323ec0a Bump dart-lang/setup-dart from 1.6.2 to 1.6.4 (4254)
 https://dart.googlesource.com/pub.git/+/738a726c `outdated` support for workspaces (4251)
 https://dart.googlesource.com/pub.git/+/e78f13f9 Validate that the same package cannot be overridden twice in workspace (4238)
 https://dart.googlesource.com/pub.git/+/cefc4b87 Handle overrides in workspaces (4249)
 https://dart.googlesource.com/pub.git/+/e1fbda73 Use lint prefer_final_locals (4247)
 https://dart.googlesource.com/pub.git/+/8d312a2a downgrade --tighten (4245)
 https://dart.googlesource.com/pub.git/+/6473e15e Refactor helpers for Package.load (4243)
 https://dart.googlesource.com/pub.git/+/0e7446a5 Write .dart_tool/pub/workspace_ref.json (4240)
 https://dart.googlesource.com/pub.git/+/66197259 Don't print 'Resolving dependencies in `../..`...' Use absolute path instead (4231)
 https://dart.googlesource.com/pub.git/+/00d11896 Detect duplicate names in workspace packages (4232)
 https://dart.googlesource.com/pub.git/+/822e6415 Sanitize publication responses from server (4230)

```

Diff: https://dart.googlesource.com/pub.git/+/55cc6c138ad4777cf4fc0710c55dc37a33fdcd69..e184bfc725793cbbf222fa8d8f96da10c40af24a/
Change-Id: I5dcd3fa84da00b27689d8e1aa19bc1762c8e5a6a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/365823
Reviewed-by: Jonas Jensen <jonasfj@google.com>
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
2024-05-13 13:04:51 +00:00
Paul Berry
5b020f2ee6 [cfe] Make type inference for if-null expressions consistent with analyzer.
Fixes https://github.com/dart-lang/language/issues/3650.
Fixes https://github.com/dart-lang/sdk/issues/55436.

Bug: https://github.com/dart-lang/language/issues/3650
Change-Id: I30b39221c85713aab10f2edc35625f38e34cae5e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/362100
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2024-05-08 20:05:18 +00:00
Paul Berry
497d6105df [cfe] Make the context for await expressions consistent with analyzer.
Fixes https://github.com/dart-lang/language/issues/3649.
Fixes https://github.com/dart-lang/sdk/issues/55418.

Bug: https://github.com/dart-lang/language/issues/3649
Change-Id: Ifb2fe47bb343a357e2338843775f140c01bd8a88
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/361302
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2024-05-08 17:10:52 +00:00
Parker Lougheed
09e92e2a49 [linter] Update changelog entry and since info for 3.4
Change-Id: I597cf9117b2f61b8d6786af987d29452b7ce2243
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/365381
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Auto-Submit: Parker Lougheed <parlough@gmail.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2024-05-06 20:03:26 +00:00
Robert Nystrom
cecc51bd81 Clean up CHANGELOG for 3.4 release.
There are no content changes. I just merged some repeated sections and
cleaned up the formatting a bit. All of the language changes are
already described.

Change-Id: Ied1c9750894b9bf131f2c80bfe536dfb9cf62e21
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/365286
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Leaf Petersen <leafp@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2024-05-02 20:33:36 +00:00
Alexander Markov
6e5aae8e0f [vm] Unsound mode cleanup: remove legacy types from the VM
TEST=ci

Change-Id: I0ade9ebf5dff2b283a2c7e0ff99dc6b56f548ba9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/364622
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2024-04-30 17:49:37 +00:00
Sam Rawlins
34e29fbefb analyzer: add CHANGELOG entry regarding doNotSubmit and mustBeConst
Change-Id: I368481b88135cd0f9440cfbe10d1b990a7610d13
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/364205
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2024-04-23 22:53:29 +00:00
Kevin Chisholm
82d5407d82 [docs] merge stable CHANGELOG to main
Change-Id: Id47bf18ea0354c36cf25e6040cb49209bade32fe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/363485
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Kevin Chisholm <kevinjchisholm@google.com>
2024-04-18 15:59:01 +00:00
asiva
8e2acda7d6 [VM] Remove support for --no-sound-null-safety mode
This CL removes support for --no-sound-null-safety option, the VM will
only run sound null safety code.

First part of deleting support for legacy and unsound null safe code.

TEST=CI

Change-Id: I9dbed10a18ef102533d6af516ff5075297d17b74
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/357183
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2024-04-05 19:38:12 +00:00
Sigurd Meldgaard
924ccb025c Mention new pub directory behavior in CHANGELOG
Change-Id: Icb60021be400714049c654e0d5b3ad19df85070a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/361381
Reviewed-by: Jonas Jensen <jonasfj@google.com>
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
2024-04-05 11:41:27 +00:00
Brian Quinlan
9b2b0ac848 [docs,io] Clarify that isDirectory is not meaningful for FileSystemDeleteEvent.
Bug: https://github.com/dart-lang/sdk/issues/55130
Change-Id: I43c95218cd9f6b87ab242affa8cc2b9d42df7d96
CoreLibraryReviewExempt: documentation-only change
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/357663
Reviewed-by: Lasse Nielsen <lrn@google.com>
Reviewed-by: Brian Quinlan <bquinlan@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
2024-03-30 01:03:08 +00:00
Jonas Termansen
3cce981e6c Bump version to 3.5.
Change-Id: Iaba0d7367689c60a8c899b49311dbd64d5736be1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345306
Reviewed-by: Kevin Chisholm <kevinjchisholm@google.com>
Commit-Queue: Kevin Chisholm <kevinjchisholm@google.com>
2024-03-28 00:08:58 +00:00
Srujan Gaddam
1232260158 [dart:js_interop] Add ExternalDartReference
Closes https://github.com/dart-lang/sdk/issues/55187

Adds a faster way for users to pass opaque Dart values to
JS without the need for boxing like in JSBoxedDartObject.
This does mean, however, that this new type can't be a JS type,
and therefore cannot have interop members declared on it.
Refactors existing code to handle that distinction.

CoreLibraryReviewExempt: Backend-specific library that's been reviewed by both dart2wasm and JS compiler teams.
Change-Id: Ia86f1fe3476512fc0e5f382e05739713b687f092
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/358224
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2024-03-26 15:43:19 +00:00
Srujan Gaddam
47f08fb143 [dart:js_interop] Change several operators back to JSBoolean
Related issues:
https://github.com/dart-lang/sdk/issues/55024
https://github.com/dart-lang/sdk/issues/55267

These operators were initially broken in 3.3 and were exposed
as returning JSBoolean but implemented as returning bool. They
were fixed to return bool in the public API, but we should
prefer to have them return JS types as they're likely to be used
in cases where implicit conversions are not useful.

CoreLibraryReviewExempt: Fixing type mismatch in backend-specific library.
Change-Id: I3b0e60550dcac78918f8399d11238dcfa34982cd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/359180
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2024-03-25 17:05:36 +00:00
Lasse R.H. Nielsen
5acb2132f8 Constant evaluator won't assume all dart.library.x entries exist.
The existing implementation assumed, hardcoded, that the compilation
environment had an entry for any string of the form `dart.library.`+X,
with a value of either `"true"` or `""`.
This did not match the runtime behavior of the standalone VM,
which allows non-constant access to the compilation environment.

Changed to only have entries with value `"true"` for libraries
which exist.
This changes the value of `bool.hasEnvironment` or a
`String.fromEnvironment` or `bool.fromEnvironment` with a
non-default `defaultValue`.
The existing behavior was that `bool.hasEnvironment` was always true,
and that the other constructors ignored the `defaultValue`,
so most likely such tests or `defaultValues` aren't used anyway.

Fixes #53815

Bug: https://dartbug.com/53815
Change-Id: I995bb34b5ab04b39a8a588d6a59c0027a0fe855c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/331261
Commit-Queue: Lasse Nielsen <lrn@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2024-03-23 11:18:46 +00:00
Alexander Markov
17d6ba15b6 [vm] Remove external strings
This change removes support for external strings from the VM along with
Dart_NewExternalLatin1String, Dart_NewExternalUTF16String and
Dart_IsExternalString Dart C API functions.

External strings are not used by the VM nor any known embedder, but
Dart VM was paying the maintenance and performance price for
the external string implementation classes.

TEST=ci

Change-Id: I094cd2d2b7ec0840e9f09e1ca9e5a7acd4e78c28
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/358760
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2024-03-20 20:08:13 +00:00
Keerti Parthasarathy
d4701442c6 Update changelog for improvements in code completion
Change-Id: I0e90ac68c433b3e7a40fb0f9c7cdff866737ccf9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/358260
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-03-19 17:35:28 +00:00
Sigurd Meldgaard
74c94ee2d3 Bump pub to e519de6b6da5aea4f78e58f8906059cc6c2a5993
Changes:
```
> git log --format="%C(auto) %h %s" 5b5fdd3..e519de6
 https://dart.googlesource.com/pub.git/+/e519de6b Refactor `Entrypoint.rootDir` preparing for workspaces (4179)
 https://dart.googlesource.com/pub.git/+/c60b1a05 Allow relative path-dependencies from git dependencies
 https://dart.googlesource.com/pub.git/+/e08f7202 Make ensureUpToDate static (4171)
 https://dart.googlesource.com/pub.git/+/539457d2 More robust snapshot deletion (4170)
 https://dart.googlesource.com/pub.git/+/3b837a17 Show progress while downloading dependencies (4175)
 https://dart.googlesource.com/pub.git/+/4e48ab75 Use resident compiler to start test runner (4174)
 https://dart.googlesource.com/pub.git/+/6758a570 Fix typo (4173)
 https://dart.googlesource.com/pub.git/+/93dc0a1e Use the 'pub_display_url' field in advisories in output of pub get/up… (4172)
 https://dart.googlesource.com/pub.git/+/039ca5e4 Remove Entrypoint._configRoot (4169)
 https://dart.googlesource.com/pub.git/+/85304da4 Refactor test setup for security advisories (4167)
 https://dart.googlesource.com/pub.git/+/161bee84 Move helpers inside ensureUpToDate (4166)
 https://dart.googlesource.com/pub.git/+/badcd8d7 Mention zshrc as possible shell config file (4163)
 https://dart.googlesource.com/pub.git/+/44bd80e4 isUpToDate based on package_config.json (4160)
 https://dart.googlesource.com/pub.git/+/98823618 fix: False detection of non-ignored files with non-ascii unicode characters (4145)
 https://dart.googlesource.com/pub.git/+/4743a455 Support for resolving all packages in workspace together (4154)
 https://dart.googlesource.com/pub.git/+/89376e84 Make FlutterSDK singleton, and move static members to non-static (4159)

```

Diff: https://dart.googlesource.com/pub.git/+/5b5fdd320a3b60a6a00bdd3122f03c6f67a39eeb..e519de6b6da5aea4f78e58f8906059cc6c2a5993/
Change-Id: I20a86848c72b4eddf0fab62c7d54815ff2221203
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/357880
Reviewed-by: Jonas Jensen <jonasfj@google.com>
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
2024-03-15 12:45:51 +00:00
Paul Berry
fb210554eb Enable feature inference-update-3.
In discussion with the language team, we've decided to ship this
feature in Dart 3.4. This CL contains a minimal CHANGELOG entry for
the feature; I plan to expand on it once I'm finished with the feature
specification document.

Change-Id: Iac86ebed322feb8e478bf5a6780d50adb433ed7f
Tested: trybots
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/355900
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2024-03-13 22:04:23 +00:00
Srujan Gaddam
e1834792c3 [dart:js_interop] Fix comparison operator return types
Fixes https://github.com/dart-lang/sdk/issues/55024

The patch files for these operators return a bool, whereas
the public API returns a JSBoolean. Since there's only one
possible return type, we should make them return bool for
convenience. Boolean conversion is also inexpensive on
dart2wasm, so that shouldn't be an issue.

Also adds helpers to operator_test to make sure any JS values
are converted before they're compared, adding additional type
checking through the conversion.

CoreLibraryReviewExempt: Fixes type mismatch in backend-specific library.
Change-Id: I7ff2e334e817e6e7d7d8d5091a4e5d570a496b03
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/354702
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2024-03-04 21:10:02 +00:00
Sigurd Meldgaard
b0035f1eef Bump pub to 5b5fdd320a3b60a6a00bdd3122f03c6f67a39eeb
Changes:
```
> git log --format="%C(auto) %h %s" 4ab2e36..5b5fdd3
 https://dart.googlesource.com/pub.git/+/5b5fdd32 Do not show advisories text if no version is affected (4157)
 https://dart.googlesource.com/pub.git/+/4edf5cb2 Do not report ignored advisories in 'pub outdated' (4156)
 https://dart.googlesource.com/pub.git/+/c0e83746 Fix output of 'pub outdated' when there are several advisories (4158)
 https://dart.googlesource.com/pub.git/+/33e2b914 Make class private (4152)
 https://dart.googlesource.com/pub.git/+/c28f96a1 Prefer IPV4 on localhost, serve testserver on IPV4 (4149)
 https://dart.googlesource.com/pub.git/+/54293e3b Include info about security advisories in json output of `pub outdated` (4148)
 https://dart.googlesource.com/pub.git/+/48d3a544 Cleanup unused method (4147)
 https://dart.googlesource.com/pub.git/+/baa19b6c Make a RootDescription not depend on the root Package (4140)
 https://dart.googlesource.com/pub.git/+/93ce284d Surface security advisories in pub outdated (4136)
 https://dart.googlesource.com/pub.git/+/b1698df0 Always pass --git-dir when handling repoCache (4142)
 https://dart.googlesource.com/pub.git/+/d664d7f0 Devtools Extension validator (4135)
 https://dart.googlesource.com/pub.git/+/235e9421 Implement command "unpack" (4111)
 https://dart.googlesource.com/pub.git/+/f68b0e18 Remove stray comment (4137)
 https://dart.googlesource.com/pub.git/+/8c8814df Rename GitResolvedDescription to ResolvedGitDescription (4138)
 https://dart.googlesource.com/pub.git/+/3d285a39 Support for workspace syntax in pubspec.yaml (4128)
 https://dart.googlesource.com/pub.git/+/f8b23495 Update the repository specification (4134)
 https://dart.googlesource.com/pub.git/+/d948454f Bump dart-lang/setup-dart from 1.6.0 to 1.6.2 (4133)
 https://dart.googlesource.com/pub.git/+/465a45cd Bump checks from 0.2.2 to 0.3.0 (4132)

```

Diff: https://dart.googlesource.com/pub.git/+/4ab2e3663f0a98be40427e004e789caebf3ea72e..5b5fdd320a3b60a6a00bdd3122f03c6f67a39eeb/
Change-Id: I440f41b0e00c610d9e821b955345094c48dae8da
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/355421
Reviewed-by: Sarah Zakarias <zarah@google.com>
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
2024-03-04 15:25:40 +00:00
Parker Lougheed
aace41035f [changelog] Add entries for recent DevTools releases
Change-Id: If4a1741d28a351ef93d2f7ada468d78272e1ab54
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352161
Reviewed-by: Kenzie Davisson <kenzieschmoll@google.com>
Reviewed-by: Kevin Chisholm <kevinjchisholm@google.com>
Commit-Queue: Marya Belanger <mbelanger@google.com>
2024-02-29 18:19:38 +00:00
Vyacheslav Egorov
9e11d79657 [vm] Remove dart:cli waitFor
Closes https://github.com/dart-lang/sdk/issues/52121

Tested: CI
CoreLibraryReviewExempt: Approved breaking change to VM specific code
Change-Id: Icc89017c5a7676c2ae07488692ad8b8b9e131a7f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/354880
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2024-02-29 11:18:51 +00:00
Lasse R.H. Nielsen
1436635d27 Add more information to ParalleWaitError.toString.
Gives the constructor optional parameters for providing
more information that can be used in the `toString` message,
and the `stackTrace` getter.
Makes the `iterable.wait` and `record.wait` extension methods
provide such information, so that the `toString` will always
contain the text of *one* of the errors.

(No issue, problem with logging was brought up in chat.)

Change-Id: I5f9a20ad0af0c64a2e7ff3cdb56f187a5cf5a3ca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/353080
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2024-02-28 20:36:58 +00:00
Ben Konyi
ce642d040f [ CLI ] Add support for passing VM options to Dart runtimes via DART_VM_OPTIONS
The DART_VM_OPTIONS environment variable allows for users to specify a
set of VM options to be processed by the Dart runtime in a
self-contained executable created by `dart compile exe`.

DART_VM_OPTIONS should be a comma separated list of options and flags
with no whitespace. Options that accept multiple values as a list of
comma separated values are not supported and will result in argument
parsing failing.

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

TEST=compile_test.dart

Change-Id: I1d94ab1b992753a7dd69da722c051c9464d6d1cf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/353820
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2024-02-26 21:07:40 +00:00
Brian Quinlan
770f44d4e9 [io] Make it possible to change the line ending output by stdout and stderr.
There is a performance impact in:
`stdout.lineTerminator = "\r\n";`

For small writes (<100 chars), the performance loss is lost in the noise of the `write` system call.

For writes of ~500 chars, the performance is about half of that without line terminator translation. But, on a M2 Mac laptop, ~80M characters can be written per second.

Bug: https://github.com/dart-lang/sdk/issues/53161
Change-Id: Icfa0f981dcf6edb856d8aac5e0e270bc0148d498
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/326761
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Ömer Ağacan <omersa@google.com>
Reviewed-by: Brian Quinlan <bquinlan@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
2024-02-16 20:06:03 +00:00
Paul Berry
c9e2b012b1 Make the type schema for null-aware spread operations consistent.
Prior to this CL, the CFE used a nullable type schema for null-aware
spread operators in list literals, but a non-nullable type schema for
null-aware spread operators in set and map literals. This was clearly
an oversight; a nullable type schema should be used for for null-aware
spread operators in all kinds of collection literals.

This change brings the CFE into alignment with the analyzer.

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

Change-Id: I0d5aa128656c22211228f0dd35ccee40925b4ef0
Bug: https://github.com/dart-lang/sdk/issues/54828
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/349921
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2024-02-13 22:25:41 +00:00
Erik Ernst
f9266472c0 Add extension types to the CHANGELOG.
Change-Id: Id3bf8bd8b0a366ce58eb9070f0e2fa15d55bf07d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350002
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
2024-02-12 08:20:47 +00:00
Stephen Adams
7ef215a4a5 Reapply "[typed_data] Deprecate unmodifiable views"
This change, for Dart 3.4, deprecates the unmodifiable typed data constructors. Users of these constructors can upgrade the use of the constructors to instance method `asUnmodifiableView()`, or pin to Dart 3.3.

See https://github.com/dart-lang/sdk/issues/53785 for context.

CoreLibraryReviewExempt: Reviewed in https://dart-review.googlesource.com/c/sdk/+/321922
Issue: #53785
Change-Id: Icd52f2b6cd05cf3a328c82c197ef44d0b340b171
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332581
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2024-02-06 23:30:49 +00:00
Parker Lougheed
0a0f6915ca [ffi] Add missing changelog entries for dart:ffi
Includes changelog additions and `@Since` version fixes for https://dart-review.googlesource.com/c/sdk/+/349260.

CoreLibraryReviewExempt: No functional change and dart:ffi is only supported by the VM and dart2wasm.
Change-Id: Iad0c4d3686278312715ec5fc5374b3c983b71d1e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/349765
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Auto-Submit: Parker Lougheed <parlough@gmail.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2024-02-05 16:28:04 +00:00
Paul Berry
3636c8a08b Fix pattern context type schema for cast patterns.
According to the patterns spec, the pattern context type schema for a
cast pattern should be `_`. What was actually implemented was
`Object?`.

This is unlikely to make a difference in practice, since (a) cast
patterns are unlikely to be used in circumstances where the pattern
context type schema makes a difference, and (b) it takes some effort
to come up with expressions whose type inference behavior is differenc
between a schema of `Object?` and a schema of `_`.

Change-Id: I695752c8c163621a34faaa8d62b2b076c8152eb0
Bug: https://github.com/dart-lang/sdk/issues/54640
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/346383
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2024-01-31 17:23:20 +00:00
Parker Lougheed
75eb5800db [analyzer] Add some significant updates to 3.3 changelog
Too much has changed to enumerate it all, but we can highlight a few new features. This help developers know what's possible now and also can boost their confidence that Dart is continuing to improve.

Change-Id: I6aa39dbc6276dfddb7bcc595277ca40a9308371f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/348541
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-01-26 21:10:55 +00:00
Srujan Gaddam
3b294fdab2 [dart:js_interop] Add isA helper
Closes https://github.com/dart-lang/sdk/issues/54138

Adds a helper to do better type-checks so that users don't
accidentally using is checks or have to manually do the right
typeof or instanceof checks. In order to do this, there is
some refactoring to make ExportCreator a SharedInteropTransformer
(as it's shared across all backends) so that we can reuse an
existing visitor. In the same class, we remove unnecessary setting
of parent pointers. We should clean up the fileOffsets as well,
but dart2js verifies that those are set, so we keep them as is
for now. Also adds some static errors for edge cases.

CoreLibraryReviewExempt: Helper for web-specific library.
Change-Id: I34d818ada1349b69afd15d170d3fafa0460f65fa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/347225
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2024-01-25 18:52:45 +00:00
Srujan Gaddam
a6e8759888 [dart2wasm] Add concrete box and symbol for JSBoxedDartObject
The current implementation externalizes and internalizes the Dart
value instead of adding a box and using a runtime-specific symbol.
This makes the implementation consistent with the JS backends.

Change-Id: Iefa382f742bc819b18dfe27ca33741b12473ee39
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/347222
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2024-01-23 23:39:49 +00:00
Parker Lougheed
af89e96b06 [docs] Cleanup and fix recent changelog entries
- Fixes a few spelling and grammar errors
- Standardizes formatting a bit
- Add a link to learn more about the 3.3 language change
- Adjusts wording of a few mentions to ease global understanding

Change-Id: I8755fe219f2ef12c2c89541e0e94484bf85c0bb6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/346601
Reviewed-by: Marya Belanger <mbelanger@google.com>
Auto-Submit: Parker Lougheed <parlough@gmail.com>
Commit-Queue: Marya Belanger <mbelanger@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2024-01-19 20:30:45 +00:00
Sarah Zakarias
bfe68f9ff5 Add entry in changelog about security advisories in pub
Change-Id: I207ca64174cde1647671af7002feb6386a1c6444
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/346040
Commit-Queue: Sarah Zakarias <zarah@google.com>
Reviewed-by: Sigurd Meldgaard <sigurdm@google.com>
2024-01-15 09:46:05 +00:00