1
0
mirror of https://github.com/dart-lang/sdk synced 2024-07-05 09:20:04 +00:00
Commit Graph

1287 Commits

Author SHA1 Message Date
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
Srujan Gaddam
4a2cd36a3d [dart:js_interop(_unsafe)] Add changelog entries for importModule and has
Change-Id: I4ccc48f9acca6796f46db73bb48dd3b1adeb4bbe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345141
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
2024-01-06 01:03:28 +00:00
Jonas Termansen
8158275a94 Bump version to 3.4.
Do not revert: The main channel version must be upgraded now that the
version 3.3 beta has been cut and reverting this change puts the
release infrastructure into an unsupported state. Please fix forward
any potential problems that occur downstream and loop me into the
discussions so we can improve the release procedures in the future.

Change-Id: I8706c3d74fe0474d34a99c5cbbb8e9a88b586cdd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/329902
Commit-Queue: Jonas Termansen <sortie@google.com>
Reviewed-by: Kevin Chisholm <kevinjchisholm@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2024-01-04 16:15:09 +00:00
Srujan Gaddam
3a80ec26be Reland "[dart2wasm] Disallow use of old interop libraries"
Includes small wording modifications and extra allowlisting for
benchmarks and Flutter engine tests.

This reverts commit c97a17b2349bcbdadd34204a65a9e7c7c13def83.

Change-Id: I2db391782c98c351d744ea7201c9421f13b97979
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/343689
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
2024-01-02 21:14:50 +00:00
Srujan Gaddam
5f34ac9fa0 Revert "[dart2wasm] Disallow use of old interop libraries"
This reverts commit 8c246caa91.

Reason for revert: Need to allowlist benchmarks to use package:js.

Original change's description:
> [dart2wasm] Disallow use of old interop libraries
>
> Closes https://github.com/dart-lang/sdk/issues/54004
>
> Adds an error for imports of old interop libraries. Has an
> allowlist for existing usages/migrated usages that we'll need
> to migrate.
>
> Change-Id: Ie7174ae2a50c2d03a7aa2975e8a1914a4cba8a2c
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/342521
> Reviewed-by: Sigmund Cherem <sigmund@google.com>
> Commit-Queue: Srujan Gaddam <srujzs@google.com>

Change-Id: Id7d3a3063d417830774d7a72eed5185599f9267f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/343685
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
2023-12-28 16:22:21 +00:00
Srujan Gaddam
8c246caa91 [dart2wasm] Disallow use of old interop libraries
Closes https://github.com/dart-lang/sdk/issues/54004

Adds an error for imports of old interop libraries. Has an
allowlist for existing usages/migrated usages that we'll need
to migrate.

Change-Id: Ie7174ae2a50c2d03a7aa2975e8a1914a4cba8a2c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/342521
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2023-12-27 18:31:37 +00:00
Srujan Gaddam
6fbd07f2b0 [dart:js_interop] Reach (mostly) parity with js_util
https://github.com/dart-lang/sdk/issues/54004

In order to reach parity with js_util, we expose operators
through an extension and do some partial renames in order
to make the member names sound better e.g. `equals` instead
of `equal`. We also expose the following from js_util:

- NullRejectionException

We don't expose `isJavaScriptArray` and `isJavaScriptSimpleObject`
as they can expressed through other forms of interop. There
was an esoteric bug where we needed these members for Firefox
in pkg:test, but the package no longer uses these members, so to
avoid increasing the API space too much, we do not export them.

For the same reason, we also don't expose `objectGetPrototypeOf`,
`objectPrototype`, `objectKeys`.

We don't expose `allowInteropCaptureThis` as it will take some
work to handle this in dart2wasm. That work is tracked in
https://github.com/dart-lang/sdk/issues/54381.

Lastly, `instanceof` and `instanceOfString` is moved to be on
`JSAny?`, as this operator is useful to avoid needing to
downcast to `JSObject` e.g. `any.instanceOfString('Window')`
instead of `any.typeofEquals('object') &&
(any as JSObject).instanceOfString('Window')`.

Extensions are reorganized and renamed to handle these changes.

CoreLibraryReviewExempt: Backend-specific library.
Change-Id: Ib1a7fabc3fa985ef6638620becccd27eeca68c25
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/341140
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2023-12-25 20:02:49 +00:00
Simon Binder
150e61a662 [vm/ffi] Support @Native fields
Allow annotating top-level or static fields with `@Native` to create
fields backed by native memory.
By using the `_addressOf` operator implemented in the VM, these fields
can be implemented in the CFE by replacing them with accessors looking
up the pointer and then using existing methods to load and store the
value.

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

TEST=tests/ffi/native_assets/asset_*_test.dart
TEST=pkg/analyzer/test/src/diagnostics/ffi_native_test.dart

CoreLibraryReviewExempt: VM & dart2wasm only feature
Change-Id: I61dccc88076723d6a6ba02d7fd848b18e4caf780
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/338020
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2023-12-15 11:20:23 +00:00
Srujan Gaddam
e6a313568c [dart:js_interop] Add generics to JSArray and JSPromise
In order to support this, adds necessary changes to conversion
functions (including cast-lists) and makes JSArrayImpl a generic
type.

CoreLibraryReviewExempt: Backend-specific library changes.
Change-Id: I58bcfb67ef21c90be5e25735757d780aac52dc23
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/337923
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2023-12-12 04:50:13 +00:00
Paul Berry
004f564f40 Allow "field promotion" to apply to abstract getters.
A quirk of analyzer and CFE implementations is that they resolve
property gets such as `foo.bar` to specific field or getter
declarations that may be not be directly defined on the target type;
for example if `foo` has type `B`, and `B` extends `A`, and `A`
contains a field called `bar`, then `foo.bar` is considered to refer
to `A.bar`, for example:

    class A {
      int? bar;
    }
    class B extends A {}
    f(B foo) {
      print(foo.bar); // Resolved to `A.bar`.
    }

This is in contrast with the language specification, which makes a
clean distinction between class _declarations_ and the _interfaces_
implied by those declarations. While a class declaration can contain
(among other things) both getters and fields, which might be concrete
or abstract, an interface doesn't distinguish between getters and
fields, and is inherently abstract.

The advantage of the analyzer/CFE approach is that it allows more
intuitive error messages and "go to definition" behavior, which
benefits users. But it has some ill-defined corner cases involving
complex class hierarchies, because not every property access can be
resolved to a unique declaration (sometimes a getter is multiply
inherited from multiple interfaces, for example). The language spec
approach has the advantage of being well-defined and consistent even
in situations involving complex class hierarchies.

When I initially implemented field promotion, I took advantage of this
quirk of the analyzer and CFE implementations, so that I could make
property gets that refer to field declarations promotable, while
keeping property gets that refer to abstract getter declarations
non-promotable. This caused unpredictable behaviors in the ill-defined
corner cases. It also meant that in certain rare cases, a property
access might not be promoted even when it would be sound to do so
(e.g. a property access might refer to a private abstract getter
declaration, but the only concrete _implementation_ of that abstract
getter was a final field).

This CL changes the rule for promotability so that any get of a
private property is considered promotable, provided that the
containing library doesn't contain any concrete getters, non-final
fields, or external fields with the same name. It no longer matters
whether the private property refers to a field or a getter. This rule
is simpler than the old rule, restores the spec's clean distinction
between class declarations and interfaces, and allows more promotions
without sacrificing soundness.

For additional details please see the breaking change announcement at
https://github.com/dart-lang/sdk/issues/54056, as well as the original
change proposal at https://github.com/dart-lang/language/issues/3328.

Fixes https://github.com/dart-lang/sdk/issues/54056.
Fixes https://github.com/dart-lang/language/issues/3328.

Change-Id: I38ffcb9ecce8bccb93b1b2586a1222a0fb1005a7
Bug: https://github.com/dart-lang/sdk/issues/54056
Bug: https://github.com/dart-lang/language/issues/3328
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/337609
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2023-12-07 23:40:27 +00:00
Alexander Thomas
d4dcde2f4b [release] Add release notes for 3.2.3 stable
Change-Id: I65d9ddd93f2e41f1a8dbea799c074355636891f1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/340320
Reviewed-by: William Hesse <whesse@google.com>
2023-12-07 07:47:06 +00:00
Srujan Gaddam
b1a7ca77e0 [dart:js_interop] Move JS types to extension types
- Removes @staticInterop JS types declarations in favor of
typedefs (the function types' reified types and the typed data's
reified types have changed to make the type hierarchy work in the
JS backends).
- Adds extension types to dart:js_interop
- Adds a fromInteropObject helper to JSObject to avoid casting to
an extension type
- Deletes now stale tests
- Refactors some dart2wasm @staticInterop declarations since they
can no longer implement JS types
- Updates extension types tests to use the prefix extension_type
instead of inline_class
- Updates comments

CoreLibraryReviewExempt: Backend-specific library.
Change-Id: Ibe04afac9585ddb99fcf6dbaa7f12050d8b876dc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332860
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2023-12-06 21:59:58 +00:00
Mayank Patke
4e3cc1cb41 [dart2js] Don't minify Invocation.memberName
Fixes: #54201
Change-Id: I3cc66263a86668ee46743e46564b175d60143916
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/338947
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2023-12-06 18:57:15 +00:00
Alexander Thomas
9b4c2f01b6 [release] Add 3.2.1 and 3.2.2 release notes from stable
Change-Id: I5da5d7154a04da8de062a489a13b69cee0779710
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/339402
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2023-12-05 08:24:23 +00:00
Vyacheslav Egorov
08d7e0aab2 [vm] Disable waitFor for 3.3 release
Revert "[vm] Enable waitFor for 3.2 release"

This reverts commit f8086ed78c.

R=kustermann@google.com
TEST=covered by existing tests

Bug: https://github.com/dart-lang/sdk/issues/52121
Change-Id: Ic5c7ad9af8ff142564ce237f868dd39354dfd615
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/338761
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2023-11-29 09:29:11 +00:00
MarchMore
f621b43f95 Fixed naming in example
Closes https://github.com/dart-lang/sdk/pull/54076

GitOrigin-RevId: 6b5df842449b52dfd59c8059df78cefe0265a668
Change-Id: I53b72087186f5dc66a3f6f55b0160cb9061c46c2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336822
Reviewed-by: Marya Belanger <mbelanger@google.com>
Commit-Queue: Marya Belanger <mbelanger@google.com>
2023-11-17 22:37:20 +00:00
Lasse R.H. Nielsen
a1783a9c34 String.fromCharCodes allows start and end after end of iterable.
The current `String.fromCharCodes` behavior, throwing if `start`
or `end` is larger than the length of the `charCodes` iterable,
is inconsistent with the argument being an `Iterable<int>`,
which the user is not expected to know the length of.

Most other operations that accepts or produces an `Iterable` and
restricts it to a range, will allow the range to exceed the length
of the iterable, acting like `.take(end).skip(start)`, just without
needing to create wrappers that hide the original value.

(`List.setRange` is another exception, and should probably be fixed
by allowing the range to be partially filled, since it's too hard
to change it to require a `List` argument.)

Fixes #50253, #53937

Tested: Added to `corelib/string_fromcharcodes_test.dart`
Bug: https://dartbug.com/53937, https://dartbug.com/50253, https://dartbug.com/23282
Change-Id: Ie19c5fa8e715ea1c58c9c77c247f2a563654c1aa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/333921
Commit-Queue: Lasse Nielsen <lrn@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ömer Ağacan <omersa@google.com>
2023-11-17 13:34:22 +00:00
Parker Lougheed
4830c96420 [linter] Add changelog entries for removed unrelated type lints
Change-Id: Ia55b403ef35e6ee252d36c9a86f797e0e39de1f0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/335540
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>
2023-11-10 19:06:42 +00:00
Nicholas Shahan
406e92dba6 [ddc] Remove implements text from custom formatter
Change-Id: I814dfc5b80ae3d59ad3ad53d22c4d40866c6d926
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/334004
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2023-11-07 00:38:34 +00:00
Nicholas Shahan
c50fcf8828 [ddc] Show "any" for type args of package js types
Ensures that `toString()` of types that contain embedded js types 
will appear the same in the old and new runtime type systems.

Issue: https://github.com/dart-lang/sdk/issues/48585
Change-Id: I71ec0e13943281e745bcf05e10aa36d093cbc0c3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/334003
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
2023-11-06 22:13:17 +00:00
Daco Harkes
acad65713c [vm] Mark NativeFieldWrapperClasses as base
TEST=build SDK (modified patch files)
TEST=tests/ffi/*
TEST=runtime/vm/*_test.cc
TEST=runtime/tests/vm/dart/*

Closes: https://github.com/dart-lang/sdk/issues/51896
CoreLibraryReviewExempt: VM only.
Change-Id: I349849001adf8f3a62f3d4f94d4bdd295c36ef4d
Cq-Include-Trybots: luci.dart.try:flutter-linux-try,vm-aot-linux-debug-x64c-try,vm-ffi-android-debug-arm-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/291761
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2023-10-31 10:23:12 +00:00
Kevin Chisholm
844fe6d955 [docs] Merge stable changes into main changelog
Change-Id: Ibd756739a08fd7e44b32ec7f5d8eccf29c666895
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332182
Commit-Queue: Kevin Chisholm <kevinjchisholm@google.com>
Reviewed-by: William Hesse <whesse@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
2023-10-25 12:22:12 +00:00