1. Remove limitation of http response status code check. It used to be [100, 599]. Extends range to [0, 999] to allow users to use customized status code.
2. Rephrase some http exceptions to be more informative.
3. Possibly a bug in isHead setter, where it is only allowed to set to true.
Bug: https://github.com/dart-lang/sdk/issues/38898
Change-Id: I77d8d66eb8333dec1f53742821860b802f74f680
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134763
Commit-Queue: Zichang Guo <zichangguo@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
- Cleanup some instances of `core.Type._check()` from generated code.
- Remove assertions to avoid a bootstrap ordering issue.
- Ensure testing for FutureOr in the SDK before async.FutureOr has been
loaded returns false.
- Make the Null Safety strict mode option false by default.
Issue: #40266
Change-Id: I109432ed5226d8187b600c1d4ba6264d9b2f6a9c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135380
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
There are some tests failed after switching to NNBD. This is supposed to fix HttpException: Connection closed while receiving data.
It reduced the number of failure from 300 to 70.
The root cause is that HttpHeaders write {Transfer-Encoding: chunked} into _header field once user set it to true. However, when user tried to flip the bit,
remove() function didn't remove the content. This leads to an additional property in header. Parser alarmed when parsing it.
This is inconsistency on how others handle chunked transfer encoding. Looking at add(), set() and remove() implementation, all of them will only set _chunkedTransferEncoding instead of actually touching _header.
Bug: https://github.com/dart-lang/sdk/issues/40534
Change-Id: I80d76f3a6da01022fdb8e755e0def8a630ca376a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135353
Commit-Queue: Zichang Guo <zichangguo@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
This check is necessary to make 'for await (var i in null) {} ' throw at runtime.
Change-Id: Id68c3d422671decbe4cb3e3326d9597ad7153d84
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134871
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
This temporarily:
* sets back to opt-out all libraries in the sdk_nnbd folder until
the migration is further along
* changes the bot to use the check_nnbd_sdk script with a different libraries
file that tracks the migration progress.
Change-Id: I096df232d23e2fb41265b6a51c486fb44f9b228c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135221
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
Addresses discrepancies between IDL and template files for some
operations. There's probably more I'm missing since this was
from a cursory check through all the templates.
Change-Id: Id79710b343f4a5fe0b5529f64c341d4f63d69b9d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135222
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Named optionals without defaults should be nullable (or we need default).
Fixes:
output: org-dartlang-sdk:///dart-sdk/lib/isolate/isolate.dart:340:15: Warning: Optional parameter 'packageRoot' doesn't have a default value and its type 'Uri' doesn't allow null.
- 'Uri' is from 'dart:core'.
Uri packageRoot,
^^^^^^^^^^^
org-dartlang-sdk:///dart-sdk/lib/isolate/isolate.dart:525:15: Warning: Optional parameter 'response' doesn't have a default value and its type 'Object' doesn't allow null.
- 'Object' is from 'dart:core'.
{Object response, int priority = immediate});
Change-Id: I040939a4c058275d5e083a85b84317d76f7a568b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135040
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
Auto-Submit: Vijay Menon <vsm@google.com>
Until everyone is opted in to NNBD, we still need null checks in the
libs. This fixes corelib_2/invocation_test
This check was removed in https://dart-review.googlesource.com/c/sdk/+/123621
Change-Id: I645e8c03883bee2d5a52f1b6d19789177411199c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135220
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Stream.asyncExpand used to test result of 'convert' callback for null.
Moreover, this is a documented behavior: "If the call returns `null`,
no further action is taken for the elements." This ability was lost
when dart:async was migrated to NNBD as return type of 'convert'
becomes non-nullable. This change restores this behavior and changes
return type of 'convert' callback to be nullable.
Fixes the following tests with unforked SDK:
co19_2/LibTest/async/Stream/Stream.fromFutures_A04_t01
co19_2/LibTest/async/Stream/Stream.fromIterable_A03_t01
co19_2/LibTest/async/Stream/Stream.periodic_A04_t01
co19_2/LibTest/async/StreamController/StreamController.broadcast_A09_t01
co19_2/LibTest/async/StreamController/StreamController.broadcast_A10_t01
co19_2/LibTest/async/StreamController/stream_A02_t01
co19_2/LibTest/async/StreamController/stream_A03_t01
Change-Id: I7c9236475dc27eb2ada5bdd57cfb27fc84f72592
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135200
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
I'm hoping this doesn't give me seven years of bad luck.
Change-Id: I616bbf547ec503158ca0192815d82f1082b6a307
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134866
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Cleanup special handling for annotations required by pageloader/mirrors
use case that is now fully unsupported.
Should not be submitted until the removal of the libraries has landed
in flutter web.
https://github.com/flutter/engine/compare/master...vsmenon:vsm-mirrors
Change-Id: I00dbdc8e185a9c3e0585d030f670c1d5a4c77395
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134889
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
The null check in DateTime._withValue is needed to be backwards
compatible with legacy code which might still call DateTime
constructors with isUtc == null.
Fixes co19_2/LibTest/core/DateTime/DateTime.fromMillisecondsSinceEpoch_A02_t01
failing test after unforking SDK.
Change-Id: I5394a25d0c6a5be41cad984f98e1cf56f400106e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134869
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
It was migrated to null-safety by throwing, but that's an unnecessary breaking change.
Change-Id: I92c21d7518bf7c291b333b33a04eb4b21b7cc210
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134725
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Fixes tests lib_2/html/event_customerevent_test
co19_2/LibtTest/html/Document/window_A01_t01
JS inline incorrectly uses the converted html name for attributes for
getters. Similarly, dynamics do not need to be marked as nullable as
they are already nullable. This also fixes some of the nullability logic
for conversion input and output.
Change-Id: I77efde95a4e5d52461b3412f8650578e967ca5cd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135201
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Before migrating _InvocationMirror to NNBD, we used to check if
_type is initialized before setting it to 0.
We should do this with NNBD too, as _type could be set already and it
may contain valuable data (such as _STATIC << _LEVEL_SHIFT).
Fixes vm/cc/IsolateReload_TearOff_Remove with unforked SDK.
Change-Id: If629d6dd023d7544b7509fb5b1aa0ffcacc47aa6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135186
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Optionals were being ignored for some methods and for optionals that
have a default of Undefined or None, they should be marked nullable in
Dart syntax regardless of whether they are in the IDL.
Change-Id: Icc71300dc7d8e06fef640a5ca8d502b093c0580c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134765
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
NoSuchMethodError._invocationType is actually always -1 which is out of
range. Before NNBD migration we had an explicit range check which helped
to avoid throwing exception, but it was replaced with assert during
migration. This CL restores the range check.
Fixes co19_2/LibTest/core/NoSuchMethodError/toString_A01_t01 with
unforked SDK.
Change-Id: I91abe92491fe3a15aa422a41fefe6538baac5621
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134875
Reviewed-by: Siva Annamalai <asiva@google.com>
dartdevc_native tests also have to be updated to not wrap/unwrap generic function types.
Change-Id: I4115db483bb6668c171ec29ca7483dfabc470df5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133285
Commit-Queue: Mark Zhou <markzipan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
This reverts commit b158bf7bd5.
Reason for revert: Changes to Class::InvokeSetter trigger failure of
ASSERT(!other.IsDynamicType()); in Instance::RuntimeTypeIsSubtypeOf.
Original change's description:
> [VM/Libraries] Turn on NNBD versions of dart:io and dart:_http libraries
>
> - Turn on NNBD versions of dart:io and dart:_http libraries
> - Fix an unimplemented section in Class::InvokeSetter
>
> Change-Id: I5343a76e62c0bacaddd9b1859bef5119d80bc5ac
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134884
> Commit-Queue: Siva Annamalai <asiva@google.com>
> Reviewed-by: Régis Crelier <regis@google.com>
TBR=asiva@google.com,regis@google.com
# Not skipping CQ checks because original CL landed > 1 day ago.
Change-Id: Id98204057ff49a28c1ad5e94f8afcdfcb8261e0f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134826
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Bug: b/149075352
Event.path should call composedPath if the result of the inline is
True. As it is, it only calls it if the result is null, which is
erroneous.
Change-Id: Idacc9ccddafc4374aca10de84265bf82cfbd0ab9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134887
Reviewed-by: Sigmund Cherem <sigmund@google.com>
This should fix all ddc isolate errors. Remaining two io/_http errors are due to:
https://github.com/dart-lang/sdk/issues/40482
The rest are mirrors. Do we think we'll be able to remove it altogether? If not,
I can take a pass to fix.
Change-Id: I4cef9773b5fa36490bdfbc08a06fae6cd80c5eae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134860
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
A followup change will delete the patches that are no longer needed once
these changes have been "mirrored" :P to the libraries files in the
flutter repos.
Change-Id: I7d255838b97922198248b29311facd4956001e25
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134405
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
When growing an array, we're checking if element type is nullable.
The problem is that 'null is! T' is true for legacy types T
(other than top types and Null), so it throws for List<int*>.
In order to be able to grow arrays with all element types which can
hold null (including legacy element types) this test is changed to
null as T;
which throws type error if T cannot hold null.
Change-Id: Icf0a397109945b049b4aaead4c7eab11d903c45b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134790
Reviewed-by: Liam Appelbe <liama@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
-Adds field for type nullability for IDL operations
-Adds field for conversions to reflect input and output type nullability
--based on implementation
-Corrects generic object types to include nullability
-Changes 'any' types to dynamics
-Adds nullability to types in various operations
-Converts finals and non-initialized non-nullable fields to getters and
setters
--TODO: convert these to native instead of JS inline
-Modifies nullability for annotations and removes annotations from
setters
Change-Id: Iab19830fd1d7f37b170a4da8672f922c3f9b0863
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132967
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>