Commit graph

1224 commits

Author SHA1 Message Date
Kevin Chisholm a744a03491 Update CHANGELOG.md to add release date to 3.1.0 release.
Change-Id: I17720269d12431e2ba705ee709414d77a6621d6c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/326660
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Kevin Chisholm <kevinjchisholm@google.com>
2023-09-18 14:14:09 +00:00
Kevin Chisholm 07c5092444 [docs][release] Merge stable Changelog to main and update broken links.
Change-Id: Iba25e89e98332ccd8b0f4e18213cebc39bbe7f0b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/326141
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Kevin Chisholm <kevinjchisholm@google.com>
2023-09-14 17:56:08 +00:00
Vyacheslav Egorov 9900af07d4 Add CHANGELOG.md for waitFor
R=kustermann@google.com

Change-Id: I64d09f62790790bc1f35a565a5ecf6ebbc109377
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/326061
Reviewed-by: Martin Kustermann <kustermann@google.com>
2023-09-14 10:58:14 +00:00
Paul Berry 7c38351cbb Improve explanation of noSuchMethod / field promotion interaction in CHANGELOG.
Fixes #53510.

Bug: https://github.com/dart-lang/sdk/issues/53510
Change-Id: I25b9bb4c59a4c438c7d4f48cf955e388c22378f4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325740
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2023-09-13 17:56:25 +00:00
Robert Nystrom b35c645302 Roll the latest dart_style into the SDK.
There are a couple of small format changes, but they are minimal
enough that we might not need to land a pre-built SDK with this.

Change-Id: I1d258c8a782e5db24c2048f407a8b7cf7b948eef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325580
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
2023-09-13 01:44:57 +00:00
Liam Appelbe d5555377ed Add changelog entry for NativeCallable
Bug: https://github.com/dart-lang/sdk/issues/53322
Change-Id: I458ea1a920f68e3de23008649748a24602bb5e0e
Fixes: https://github.com/dart-lang/sdk/issues/53322
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/324180
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
Auto-Submit: Liam Appelbe <liama@google.com>
2023-09-11 22:25:06 +00:00
Brian Quinlan 8a91749e42 Fix parsing of folded header field values.
Bug: https://github.com/dart-lang/sdk/issues/53227
Bug: https://github.com/dart-lang/sdk/issues/53185
Change-Id: Ibbdbdf9c8f2875e8f687244982810fffee20e69c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/320920
Commit-Queue: Brian Quinlan <bquinlan@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2023-09-11 21:13:58 +00:00
Jackson Gardner db214e8c81 Revert "[dart:js_interop] Re-enable type checks on external APIs"
This reverts commit 2a669c571f.

Reason for revert: Failing dart -> Flutter Engine roller. We need to make some changes on the engine side to prepare for re-enabling these checks.

Original change's description:
> [dart:js_interop] Re-enable type checks on external APIs
>
> External APIs when using dart:js_interop should only allow
> primitives, JS types, and other static interop types. This
> was previously checked in a more restrictive mode called
> "strict mode" but is not checked everywhere where dart:js_interop
> APIs exist.
>
> Change-Id: Ic82a3ec0bf6062c25d7f8933e503820a21bc191f
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/316867
> Reviewed-by: Sigmund Cherem <sigmund@google.com>
> Commit-Queue: Srujan Gaddam <srujzs@google.com>

Change-Id: I54caf06976e215b2b576cedfc0013ee79c6682f6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/324902
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
2023-09-11 19:31:20 +00:00
Srujan Gaddam 2a669c571f [dart:js_interop] Re-enable type checks on external APIs
External APIs when using dart:js_interop should only allow
primitives, JS types, and other static interop types. This
was previously checked in a more restrictive mode called
"strict mode" but is not checked everywhere where dart:js_interop
APIs exist.

Change-Id: Ic82a3ec0bf6062c25d7f8933e503820a21bc191f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/316867
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2023-09-05 16:05:08 +00:00
Sigurd Meldgaard 22c467636f Bump pub to be6868ba132c782d9835b1638a634ecb73428579
Changes:
```
> git log --format="%C(auto) %h %s" 42819a1..be6868b
 https://dart.googlesource.com/pub.git/+/be6868ba Improve precompilation (4005)
 https://dart.googlesource.com/pub.git/+/1ff7ed9f `upgrade --tighten` (3957)
 https://dart.googlesource.com/pub.git/+/a2ff15af Bump actions/checkout from 3.5.3 to 3.6.0 (4007)
 https://dart.googlesource.com/pub.git/+/9c041f97 Revert "Validate pubspec names after resolution, instead of when parsing (3956)" (4006)
 https://dart.googlesource.com/pub.git/+/62981e8c Switch vendor to a dev dependency (3997)
 https://dart.googlesource.com/pub.git/+/edcd5c2a Don't display detailed errors from credentials file (4004)
 https://dart.googlesource.com/pub.git/+/bddb0b8a Fix test expectation (4000)
 https://dart.googlesource.com/pub.git/+/c5541b33 Fix spelling errors (3999)
 https://dart.googlesource.com/pub.git/+/ee3f0ff7 Log missing compilation output (3992)
 https://dart.googlesource.com/pub.git/+/57e5d581 Remove remaining remnants of old packages folder and .packages file (3989)
 https://dart.googlesource.com/pub.git/+/edc76a1c Cleanup meta annotation usage (3990)
 https://dart.googlesource.com/pub.git/+/d619b373 Replace Pair usage with records (3988)
 https://dart.googlesource.com/pub.git/+/923cb7bd Enable lints to use new language features (3987)
 https://dart.googlesource.com/pub.git/+/78a39b05 Fix some type related lints (3986)
 https://dart.googlesource.com/pub.git/+/f41c6c80 Update Dart spec reserved words (3984)
 https://dart.googlesource.com/pub.git/+/6c267643 Fix and increase flexibility of language version override test (3985)
 https://dart.googlesource.com/pub.git/+/037138e6 Validate pubspec names after resolution, instead of when parsing (3956)
 https://dart.googlesource.com/pub.git/+/4d4ff446 Show dependency type changes in report (3954)
 https://dart.googlesource.com/pub.git/+/996fdcfd `pub add` Rely on git sources validation of --git-url (3951)
 https://dart.googlesource.com/pub.git/+/d7647400 Update tar (3976)
 https://dart.googlesource.com/pub.git/+/98565c3e Bump actions/checkout from 3.5.2 to 3.5.3 (3960)
 https://dart.googlesource.com/pub.git/+/f323772e Summary for `pub get`, don't show unchanged in `pub upgrade` (3952)

```

Diff: https://dart.googlesource.com/pub.git/+/42819a1e10f803eb7f6296692c5a976e1c647360..be6868ba132c782d9835b1638a634ecb73428579/
Change-Id: I4b4f42790bb50ad4b17bdf2ac195494a241a63f0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/324101
Reviewed-by: Jonas Jensen <jonasfj@google.com>
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
2023-09-04 14:56:52 +00:00
Paul Berry 0428501a59 Add a CHANGELOG entry for private field promotion.
Bug: https://github.com/dart-lang/language/issues/2020
Change-Id: Iab3ab8fc3656941e7df91681b14a7d4e2355fb3b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/323502
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2023-08-30 20:57:25 +00:00
Parker Lougheed 9e761d5a10 [linter] Account for new lints in 3.1.0 release
Bug: https://github.com/dart-lang/linter/pull/4678#issuecomment-1685125753
Change-Id: I8fe1bcea8cc0db26b1375cb95ebe6ec51b6b63ec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/322380
Auto-Submit: Parker Lougheed <parlough@gmail.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2023-08-23 20:36:05 +00:00
Parker Lougheed b199896be5 Mark packageConfigSync and resolvePackageUriSync as released in 3.2
Closes https://github.com/dart-lang/sdk/issues/53285

Bug: https://github.com/dart-lang/sdk/issues/53285
CoreLibraryReviewExempt: dart:isolate is only supported on the VM and this CL only changes a Since annotation.
Change-Id: If525aed83d3ccd69558f348e6a4a287a35b1d2ca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/322040
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2023-08-22 08:05:19 +00:00
Srujan Gaddam a38fb595cf [dart:js_interop] Add JS types for Symbol/BigInt
Adds JSSymbol and JSBigInt and erases to either their respective
interceptor types in the JS backends or JSValue in dart2wasm.

CoreLibraryReviewExempt: Backend-specific library.
Change-Id: Ib2c70d22a70c6308733cd170b91eafa8ec3b3aeb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/321749
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2023-08-21 21:54:15 +00:00
Srujan Gaddam c738fe1d7b [ddc] Add BigInt and Symbol interceptors
Adds the same interceptors from dart2js as JsPeerInterfaces
and handles typeof differences in getReifiedType. These must
be JsPeerInterfaces so that Object members can be stored in
their prototype. Tests are added so that dart2js and ddc are
consistent.

Change-Id: Iadc3dd26957c0a21b4039c49c1c1ff162ae286e6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/321748
Reviewed-by: Stephen Adams <sra@google.com>
2023-08-21 21:54:15 +00:00
Nicholas Shahan 7b6d9fb46e [ddc] Cleanup temporary fix in strSafe
Fix allowed it to accept null but it should never be called with a
nullable value.

Change-Id: I03b5d9b4906e9e4557a4f2720350c0c8176fec53
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/320841
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Auto-Submit: Nicholas Shahan <nshahan@google.com>
2023-08-21 17:42:33 +00:00
Parker Lougheed 70310b06d0 [changelog] Move utf8 return type change to 3.2
The change (81df36216f) landed after the cut off and isn't in 3.1: https://api.dart.dev/stable/3.1.0/dart-convert/Utf8Codec-class.html#:~:text=inherited-,encode,-(String%20input

Change-Id: I4394c546e07727bfd54e2f397b755b7460833985
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/321260
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2023-08-21 07:38:02 +00:00
Parker Lougheed 7289baece5 [changelog] Fix link definition in http trailing whitespace breaking change
Change-Id: I5943176c7142ba09b3ce5463f6fc410015c2c0a4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/321240
Reviewed-by: Brian Quinlan <bquinlan@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
2023-08-17 19:03:08 +00:00
Lasse R.H. Nielsen 4a38cb09f5 Fix behavior of Stream.empty.
The underlying subscription would invoke the `onDone` handler even
after a `cancel`.
It also forgot to register the `onDone` callback in the zone before
running it.

Tweaked the behavior of `pause` and `resume` to make sure they make
no difference after `cancel` or after a done event has been omitted.
(Test now checks that the behavior matches other streams.)

Fixes #53201

Bug: https://dartbug.com/53201
Change-Id: Iba35be2c4b44b5c4ec97d5a4dbcd3aff7fee8b75
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/320561
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2023-08-17 15:26:59 +00:00
Derek Xu f6bc011b37 [dart:developer] Improve documentation of Service.getIsolateId and Service.getObjectId
This CL addresses https://dart-review.googlesource.com/c/sdk/+/317220/comment/7e05218f_882e21cd/

CoreLibraryReviewExempt: This CL does not change any APIs, it just adds
an @Since annotation to a method.
Change-Id: I4187c50498668553806bb2eee6584114363b417a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/320900
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2023-08-16 15:13:47 +00:00
Srujan Gaddam ad62f6033b [dart:js_interop] Relabel globalJSObject as globalContext and point to object used in static interop lowerings
This is likely more useful than returning globalThis always. It
allows users to workaround issues with lowerings without having
to worry about browser compatibility differences.

CoreLibraryReviewExempt: Backend-specific library.
Change-Id: I01479211fe6b573c845de5b134d36338c40fc10d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/319301
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2023-08-15 20:57:17 +00:00
Srujan Gaddam 66b511fa6c [dart:js_interop] Use compiler-dependent global context
Fixes https://github.com/dart-lang/sdk/issues/52955

Instead of globalThis, dart2js and DDC will now use the same global
context that they did for non-static interop. dart2wasm will
continue to use globalThis.

Change-Id: Iec899fc73ed35c50cd688d9b45b980e94f101c0b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/318520
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2023-08-15 20:57:17 +00:00
Brian Quinlan ce0d051c9c Remove trailing whitespace from header values.
Bug: https://github.com/dart-lang/sdk/issues/53005
Bug: https://github.com/dart-lang/sdk/issues/51532
Change-Id: I8a2fc04f48d50103819d655ccd300e73d59fbecc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/319903
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
2023-08-15 16:58:12 +00:00
Parker Lougheed 9ac6332c67 [release] Minor fixes and cleanup to recent changelog entries
- Updates a few broken links
- Fixes a few spelling mistakes
- Standardizes formatting in recent entries
- Provides a few more details where helpful

Change-Id: I8d5376dfe2dec11b53cb38081f0e268c3cee51ab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/320140
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2023-08-15 01:03:19 +00:00
Paul Berry 907e705307 Flow analysis: use a more precise split point for refutable patterns.
Previously, the flow control logic for patterns didn't use the
`FlowModel.split` or `FlowModel.unsplit` methods at all. This meant
that if a control flow join point occurred in pattern logic, flow
analysis would consider the split point to be whatever split point was
established by the enclosing expression or statement. In the case of
an if-case statement, it would consider the split point to be at the
beginning of the scrutinee expression.

Split points are used by flow analysis for the sole purpose of
ensuring that joins propagate type promotions the same way in dead
code as they do in live code (so that users introducing temporary
`throw` expressions or `return` statements into their code do not have
to deal with nuisance compile errors in the (now dead) code that
follows. The consequence of flow analysis considering the split point
to be at the beginning of the scrutinee expression is that if the
scrutinee expression is proven to always throw, then joins that arise
from the pattern or guard may not behave consistently with how they
would have behaved otherwise. For example:

    int getInt(Object o) => ...;
    void consumeInt(int i) { ... }
    test(int? i) {
      if (
          // (1)
          getInt('foo')
          case
              // (2)
              int()
          // (3)
          when i == null) {
      } else {
        // (4)
        consumeInt(i);
      }
    }

In the above code, there is a join point at (4), joining control flows
from (a) the situation where the pattern `int()` failed to match, and
(b) the situation where `i == null` evaluated to `false` (and hence
`i` is promoted to non-nullable `int`). Since the return type of
`getInt` is `int`, it's impossible for the pattern `int()` to fail, so
at the join point, control flow path (a) is considered
unreacable. Therefore the promotion from control flow path (b) is
kept, and so the call to `consumeInt` is valid.

In order to decide whether to preserve promotions from one of the
control flow paths leading up to a join, flow analysis only considers
reachability relative to the corresponding split point. Prior to this
change, the split point in question occurred at (1), so if the
expression `getInt('foo')` had been replaced with `getInt(throw
UnimplementedError())`, flow analysis would have considered both
control flow paths (a) and (b) to be unreachable relative to the split
point, so it would not have preserved the promotion from (b), and
there would have been a compile time error in the (now dead) call to
`consumeInt`.

This change moves the split point from (1) to (2), so that changing
`getInt('foo')` to `getInt(throw UnimplementedError())` no longer
causes any change in type promotion behavior.

The implementation of this change is to add calls to `FlowModel.split`
and `FlowModel.unsplit` around all top-level patterns. At first glance
this might appear to affect the behavior of all patterns, but actually
the only user-visible effect is on patterns in if-case statements,
because:

- In switch statements and switch expressions, there is already a
  split point before each case.

- In irrefutable patterns, there is no user-visible effect, because
  irrefutable patterns cannot fail to match, and therefore don't do
  any control flow joins.

This change allows the split points for patterns to be determined by a
simple syntactic rule, which will facilitate some refactoring of split
points that I am currently working on.

Change-Id: I55573ba5c28b2f2e6bba8731f9e3b02613b6beb2
Bug: https://github.com/dart-lang/sdk/issues/53167
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/319381
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2023-08-11 17:09:49 +00:00
Parker Lougheed 0360930dbc [changelog] Add optional named parameter separator breaking change
Fixes https://github.com/dart-lang/sdk/issues/52491

Bug: https://github.com/dart-lang/sdk/issues/52491
Change-Id: Ief94acb7a3ba75ea555718e017e39ce2c418b41e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/320020
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
2023-08-11 14:49:32 +00:00
Parker Lougheed 80fb7b3f9d [release] Update changelog with stable patch notes
Change-Id: I5bbf530c55be59c0a7b23d5d035d266d19eecd5a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/320040
Commit-Queue: Kevin Chisholm <kevinjchisholm@google.com>
Reviewed-by: Kevin Chisholm <kevinjchisholm@google.com>
2023-08-11 14:43:13 +00:00
Srujan Gaddam 86eb49ac19 [dart:js_interop] Disallow user @staticInterop classes from subtyping most dart:_js_types types
Since user @staticInterop types are erased to JavaScriptObject, they
should only be able to subtype other types that are :> JavaScriptObject,
which are just JSObject and JSAny. Eventually all the other JS types
will move to extension types and we can remove this check.

Change-Id: If56b6770e141238b583937880ca87496780c8fac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/316865
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2023-08-08 19:17:25 +00:00
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
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
Srujan Gaddam 7d6414a6d5 [dart:js_interop] Restrict external members from using type parameters that don't extend static interop types
Since external APIs can only use primitives and JS types in static interop,
we should require that all type parameters on static interop APIs extend
another static interop type. This is the minimum required to ensure all
type parameters can be erased to JSValue. This only affects dart:js_interop
users and replaces the previous type parameter static error check.

Change-Id: Ia546874da73c808aa25deb8d54d581db783987df
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/316140
Reviewed-by: Joshua Litt <joshualitt@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2023-07-31 17:40:56 +00:00
Srujan Gaddam 18b7dd771b Reland "[dart:js_interop] Remove Object.toJS and JSNumber.toDart"
This is a reland of commit 16fcfe7eae

Original change's description:
> [dart:js_interop] Remove Object.toJS and JSNumber.toDart
>
> Modifies JSBoxedDartObject reified type on JS backends and also
> modifies JSBoxedDartObject.toDart now that a proper box is introduced.
> Also uses a JS symbol in JSBoxedDartObject.toDart for a property
> check so that different Dart apps don't accidentally share Dart
> objects. It's now an error to call this function on non-boxed objects.
>
> Fixes a type issue where creating a new object literal with the JS
> foreign function was resulting in dart2js thinking toJSBox would
> always throw. Changing the typeDescription to PlainJavaScriptObject
> instead of =Object fixes that issue.
>
> CoreLibraryReviewExempt: Backend-specific library.
> Change-Id: I5cfb1f32ff4328fafdf9831b0d8da806c39391d9
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/309082
> Reviewed-by: Joshua Litt <joshualitt@google.com>
> Commit-Queue: Srujan Gaddam <srujzs@google.com>

CoreLibraryReviewExempt: Reland.
Change-Id: If6b190f12bdf840b0259c5739f50d9bdcd27fd47
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313600
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2023-07-17 21:16:07 +00:00
Srujan Gaddam 2767fca6fe Revert "[dart:js_interop] Remove Object.toJS and JSNumber.toDart"
This reverts commit 16fcfe7eae.

Reason for revert: Flutter changes haven't landed to google3 yet.

Original change's description:
> [dart:js_interop] Remove Object.toJS and JSNumber.toDart
>
> Modifies JSBoxedDartObject reified type on JS backends and also
> modifies JSBoxedDartObject.toDart now that a proper box is introduced.
> Also uses a JS symbol in JSBoxedDartObject.toDart for a property
> check so that different Dart apps don't accidentally share Dart
> objects. It's now an error to call this function on non-boxed objects.
>
> Fixes a type issue where creating a new object literal with the JS
> foreign function was resulting in dart2js thinking toJSBox would
> always throw. Changing the typeDescription to PlainJavaScriptObject
> instead of =Object fixes that issue.
>
> CoreLibraryReviewExempt: Backend-specific library.
> Change-Id: I5cfb1f32ff4328fafdf9831b0d8da806c39391d9
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/309082
> Reviewed-by: Joshua Litt <joshualitt@google.com>
> Commit-Queue: Srujan Gaddam <srujzs@google.com>

Change-Id: I469ad04db7b49ffef47a46ccac97e909e4865719
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313580
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2023-07-13 21:06:05 +00:00
Srujan Gaddam 16fcfe7eae [dart:js_interop] Remove Object.toJS and JSNumber.toDart
Modifies JSBoxedDartObject reified type on JS backends and also
modifies JSBoxedDartObject.toDart now that a proper box is introduced.
Also uses a JS symbol in JSBoxedDartObject.toDart for a property
check so that different Dart apps don't accidentally share Dart
objects. It's now an error to call this function on non-boxed objects.

Fixes a type issue where creating a new object literal with the JS
foreign function was resulting in dart2js thinking toJSBox would
always throw. Changing the typeDescription to PlainJavaScriptObject
instead of =Object fixes that issue.

CoreLibraryReviewExempt: Backend-specific library.
Change-Id: I5cfb1f32ff4328fafdf9831b0d8da806c39391d9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/309082
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2023-07-13 20:38:11 +00:00
Kevin Moore 6709a387c6 nit: sort changelog entries by dart library name
Change-Id: I179d37e459bf697bf4cd4415dfb81e90bd2e3f5d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313220
Auto-Submit: Kevin Moore <kevmoo@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2023-07-11 20:46:55 +00:00
Martin Kustermann 48def8e49a Add CHANGELOG.md notice about change in return type of utf8.encode()
This is follow-up for [0]

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

Change-Id: I3f34a752121a369a09a5a8d7bc3c744a25e85642
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312986
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
2023-07-11 13:22:18 +00:00
Vyacheslav Egorov 4fddaf9486 [sdk] Provide Isolate.resolvePackageUriSync
TEST=augmented few existing tests

Bug: https://github.com/dart-lang/sdk/issues/52121
CoreLibraryReviewExempt: VM-only change, other platforms don't support this API.
Change-Id: I95decae6cf1a5c6ad694747313aa0dbe0a13025d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312981
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2023-07-11 12:59:33 +00:00
Srujan Gaddam bd3e6fa1a3 Revert "[dart:html] Throw exception if Window.open opens null window"
This reverts commit a356f71b71.

Reason for revert: This should be handled by throwing an exception when
the methods of the returned window are called, not when it is opened.
This would be a noisy breaking change that we don't want for 3.1. For
now, revert until the change that affects the individual methods is
landed.

Original change's description:
> [dart:html] Throw exception if Window.open opens null window
>
> Window.open silently allows a null window to be opened, and
> issues arise later when users try to use the non-null wrapper.
> This CL changes that to throw an exception if the window is null.
> This exception can be caught and recovered from. This avoids the
> larger breaking change of making this API nullable.
>
> CoreLibraryReviewExempt: Backend-specific library.
> Change-Id: I9a53a477cb370c3bc6bc26b2162ce66c5af166aa
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/306910
> Reviewed-by: Sigmund Cherem <sigmund@google.com>
> Commit-Queue: Srujan Gaddam <srujzs@google.com>

CoreLibraryReviewExempt: Revert in backend-specific library.
Change-Id: I5007b7d7aa608bfc8e5827b5f967af5573d0b758
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/309000
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2023-06-28 23:21:32 +00:00
Ivan Inozemtsev 2b250992f9 Revert "[dart:html] Move NullWindowException to implementation"
This reverts commit 14a3051552.

Reason for revert: b/289195983

Original change's description:
> [dart:html] Move NullWindowException to implementation
>
> Window.open may open a null window in more cases than expected.
> Users may not care that the window they get back is invalid if
> they never use it. Therefore, this CL moves the exception to
> the implementation of the returned window in order to reduce
> noise, but still give a way for users to recover if they wish
> to do so.
>
> CoreLibraryReviewExempt: Backend-specific library.
> Change-Id: I005cf80630cfb4db2f5ec2012cfcd0161ad10ff1
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311460
> Commit-Queue: Srujan Gaddam <srujzs@google.com>
> Reviewed-by: Sigmund Cherem <sigmund@google.com>

Change-Id: Id7c514a80fdcaa18a7eb0acdcb7f36477a04d966
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311843
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Auto-Submit: Ivan Inozemtsev <iinozemtsev@google.com>
2023-06-28 23:21:32 +00:00
Srujan Gaddam 14a3051552 [dart:html] Move NullWindowException to implementation
Window.open may open a null window in more cases than expected.
Users may not care that the window they get back is invalid if
they never use it. Therefore, this CL moves the exception to
the implementation of the returned window in order to reduce
noise, but still give a way for users to recover if they wish
to do so.

CoreLibraryReviewExempt: Backend-specific library.
Change-Id: I005cf80630cfb4db2f5ec2012cfcd0161ad10ff1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311460
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2023-06-26 22:58:08 +00:00
Kevin Chisholm 31272b2a0b [release] synching stable and main changelogs.
Change-Id: I196069b652050d7767ad23d54cca72f6d7ac0df1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/308241
Reviewed-by: Jonas Termansen <sortie@google.com>
Commit-Queue: Jonas Termansen <sortie@google.com>
2023-06-19 15:56:22 +00:00
Srujan Gaddam a356f71b71 [dart:html] Throw exception if Window.open opens null window
Window.open silently allows a null window to be opened, and
issues arise later when users try to use the non-null wrapper.
This CL changes that to throw an exception if the window is null.
This exception can be caught and recovered from. This avoids the
larger breaking change of making this API nullable.

CoreLibraryReviewExempt: Backend-specific library.
Change-Id: I9a53a477cb370c3bc6bc26b2162ce66c5af166aa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/306910
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2023-06-12 18:29:56 +00:00
Srujan Gaddam 5b3a57908d [dart:js_interop] Remove ObjectLiteral
This annotation is unneeded as named arg external constructors
is enough to determine if an object literal is created. The one
exception is an empty object literal, but our guidance is to use
utility functions to create one instead. This is a better fit for
that purpose too as an interface for an empty object literal is
more uncommon.

CoreLibraryReviewExempt: Backend-specific library.
Change-Id: I10cf891601b28ff7e56129842d099ea28863626d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/307506
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2023-06-06 20:50:36 +00:00
Robert Nystrom 7c83e8ad4a Roll dart_style into the SDK.
This includes a single commit which fixes:

https://github.com/dart-lang/dart_style/issues/1224

This doesn't need to be coordinated with a pre-built SDK update.

Change-Id: Ifaabfde1d0d3dc180cf65a1052ba8dcff3324013
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/306122
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
2023-05-30 23:51:19 +00:00
mnordine 41543dfb04 Fix typo
Closes https://github.com/dart-lang/sdk/pull/52507

GitOrigin-RevId: 7c173ed3b70a88cb6a73b3304fb53d8eaf1627ea
Change-Id: Ie4d1850e14a1b6291c54bad76dea14f624855095
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/305341
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2023-05-24 16:48:55 +00:00
Lasse R.H. Nielsen 7e56658645 Add interface to a few classes which had missed it.
Breaking change request: https://dartbug.com/52334

Four abstract pure-interface classes in `stream.dart` have
been missed, and not made into `interface` declarations
like other similar abstract interface-only classes.
They should be marked `interface`, for consistency,
and to express intent.

The classes are:
* `StreamConsumer`
* `StreamIterator`
* `StreamTransformer`
* `MultiStreamController`

All are abstract classes with only abstract instance members.

Only `StreamConsumer` has uses where it is extended.
Most of those are inside the SDK, and are fixed here.
Two more are in packages (`http_server` and `streams`).
The former is discontinued and archived, and will never have a 3.0
release. The latter is internally developed and easy to fix.

Hope to cherry pick this for 3.0.3

Tested: Modified affected tests. Only adding restrictions.
CoreLibraryReviewExempt: Adding modifiers only.
Change-Id: I41aa47e48eaf769b7bd9d3206c1079a16ef3d476
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/302204
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
2023-05-24 14:04:27 +00:00
Brian Quinlan c3e815bc7a [io] Make FileSystemEvent sealed
Bug: https://github.com/dart-lang/sdk/issues/52027, https://github.com/dart-lang/sdk/issues/51912
Change-Id: I154ffe5901e4248f48400e6c84568c9fe6dbcd83
CoreLibraryReviewExempt: aske on holiday
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/302452
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2023-05-22 23:37:31 +00:00
Brian Quinlan ee0b9ea0f8 Deprecate the Platform constructor
Bug:https://github.com/dart-lang/sdk/issues/52138
Change-Id: I9137ffe7caa1a1e9441d48b030342a528d99e8f6
CoreLibraryReviewExempt: deprecation, aske on holiday
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/303086
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2023-05-18 21:08:24 +00:00
Brian Quinlan a75e857df5 Add a Platform.lineTerminator static method
Bug: https://github.com/dart-lang/sdk/issues/52379
Change-Id: Ic3a7f06252f8a69dcfdb29c00f16557c34529652
CoreLibraryReviewExempt: Aske is on holiday
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/297260
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2023-05-18 19:57:58 +00:00
Lasse R.H. Nielsen 066106d19a Make Uri.base see IOOverrides changes to current directory.
Fixes #39796.

Tested: Case added to `io_overrides_test.dart`.
Bug: https://dartbug.com/39796
Change-Id: Id72f75f972f59f4f9b7d17e79b4bcffd6d79f2c7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/304006
Commit-Queue: Lasse Nielsen <lrn@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2023-05-17 17:27:13 +00:00