This is a breaking change. https://github.com/dart-lang/sdk/issues/37192
This change makes the name and value positional optional parameters in the
Cookie class constructor mandatory by changing the signature from
Cookie([String name, String value])
to
Cookie(String name, String value)
The parameters were already effectively mandatory as a bug introduced in
Dart 1.3.0 (2014) meant the name and value parameters could not be null, and
any such uses already threw a noSuchMethod exception because null did not
have a length getter. As such, this is not a breaking change but adopts the
current behavior as a null name and value was already of questionable use.
Breaking change: This change adds validation to the String name and String
value setters, which had not been validating the fields at all, unlike the
constructor. This also forbids the name and value from being set to null.
That meant potentially invalid cookies could be sent to servers if the
cookie was modified after construction. This change adds the validation to
follow the rule of least surprise.
The documentation has been updated accordingly and improved a bit.
Closes https://github.com/dart-lang/sdk/issues/37192
Closes https://github.com/dart-lang/sdk/issues/29463
Change-Id: Iffed3dc265ca9c68142c4372522913f9d1ff4d51
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103840
Commit-Queue: Jonas Termansen <sortie@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
These methods all were returning Uint8List, yet they were only
declared to return List<int>. This forced callers to either defensively
wrap the return values in Uint8List, or to assume the contravariant
return value:
* Utf8Codec.encode()
* BytesBuilder.takeBytes()
* BytesBuilder.toBytes()
* File.readAsBytes()
* File.readAsBytesSync()
* RandomAccessFile.read()
* RandomAccessFile.readSync()
* Uint8List.sublist()
Since it's related, this change also updates the following sublist()
methods to declare that they return the a sublist of the same type as
the source list:
* Int8List
* Uint8ClampedList
* Int16List
* Uint16List
* Int32List
* Uint32List
* Int64List
* Uint64List
* Float32List
* Float64List
* Float32x4List
* Int32x4List
* Float64x2List
Bug: https://github.com/dart-lang/sdk/issues/36900
Bug: https://github.com/dart-lang/sdk/issues/31547
Bug: https://github.com/dart-lang/sdk/issues/27818
Bug: https://github.com/dart-lang/sdk/issues/35521
Change-Id: Ic3bc1db0d64de36fb68b1d8d98037eed1464f978
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101742
Commit-Queue: Todd Volkert <tvolkert@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Run `pkg/status_file/bin/normalize.dart` across all status files.
This should solve most presubmit warnings about "existing and possibly
new status file issues".
There are remaining issues in pkg/front_end/testcases/strong.status and
pkg/front_end/testcases/text_serialization.status which will need to be
fixed manually.
Change-Id: Iceae8992c4907442481590d75c1b0a84ce29521b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106726
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Auto-Submit: Nate Bosch <nbosch@google.com>
Change-Id: Icb6f5f2b170dc3413d7d8de5dbd3001f3b8a053c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106728
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Jacob Richman <jacobr@google.com>
Commit-Queue: Jacob Richman <jacobr@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
This adds support for decorating named parameters in packages
that are imported by the package being migrated.
Change-Id: I1f803b28ad8fedcedca14421b391dc7ab879d05f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106682
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
This is an API change, but it's non-breaking, because
ClassTypeAlias.declaredElement has always returned a ClassElement; its
return type simply didn't reflect that fact.
Change-Id: I45bcfe1b371953e86f9690b7727be89a835841a3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106681
Auto-Submit: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Removes the recently-added base class to tests (which brought more with it than we needed - and caused issues on Windows) and adds in the flutter/meta packages using helpers (inc extracting the meta package to a new helper).
Re-enable skipped LSP refactor test
Change-Id: I62f8b3e300a776cae4fbd6d15deafb5b8970eef0
Change-Id: I165b9acf75a3ec9a91feb1730be2949eb4d5e5cb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106741
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
Allows the dart:_debugger import to work as it is white-listed in this
directory.
Reveals that DDK is not passing this test. The status changes from a
compile-time to a run-time error.
Change-Id: I3703496a4ede7d155a4d82286040f1a73be677ce
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106360
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Change-Id: I1d4fd85f15c16e74e4dfdf5a618de2a7f4f3ec9a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106680
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Currently, the migration engine crashes when it visits the identifier
in the following directive:
import "dart:core" as one;
This updates the migration engine to skip directives when looking
for expressions and type annotations to be migrated.
Change-Id: I079263b13e5f4c75fbfe22fa06993e7a5d4f9c16
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106660
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
This flag has been enabled since Dart 2.2.0.
Change-Id: I18e77e1659d4be1aaf06e1c2a6262ae9e8c7f922
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104760
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
Before this CL we could both crash and add wrong metadata to "part"
nodes when a part defined other parts.
This CL fixes it by
a) Not resetting a counter so *every* part in a part will be out of
bounds when trying to reference it; and
b) Check if a part directive is in bounds and ignore it if it isn't
(an error should already have been issued).
Change-Id: I3d31f2577b2120df6461c9cc1002131dbee9dbbc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106641
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Currently there's at least two issues:
* We can crash
* We can add metadata to things they weren't meant for
Change-Id: I4e277ea614ce9faa25b2bf1c5a16a5e877df225b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106640
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
The library builders uri might not be correct as the problems can
originate in parts.
Fixes#36990
Change-Id: I1c39a31052b88013df38033a49b662ce5bb86aad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106083
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
This fixes a bug where the AstBuilder fails
given a constructor of the form:
class C {
C() : super()[];
}
In the process, 2 buildInitializer methods were extracted from
the AstBuilder.endInitializers method.
Fix https://github.com/dart-lang/sdk/issues/37285
Change-Id: Icacf28b2ed0eff9b7168c97ee0c03d78e5fcd68b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106500
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
gold appears to assume shared libraries have one, though it has no effect during loading.
Bug: b/135481201
Change-Id: I6da4f829d0ab9a8e6174ddd39db6c206794f8d4e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106431
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
This will make it easier to re-use the test infrastructure for some
other tests I plan to introduce in a follow-up CL.
Change-Id: I0a243f00f342674fe38274eb46e7c1e943817785
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106442
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>