Commit graph

390 commits

Author SHA1 Message Date
Zichang Guo 91eee195fc [http] loosen status code constraints and rephrase some http exceptions
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>
2020-02-12 22:21:57 +00:00
Nicholas Shahan dd9adebad0 [dartdevc] Fixes to support un-forking dart:_runtime
- 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>
2020-02-12 22:10:48 +00:00
Joshua Litt 60295a2cef [dart2js] Migrate async_patch.dart to nnbd.
Change-Id: I11a78e5f085e0121a7bdd34de7ab92bddca44f60
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135480
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2020-02-12 20:09:47 +00:00
Sigmund Cherem 272a03a71d [ddc,dart2js] restore null check in dart:js
Change-Id: I275c202368eabc3d72fb49ff21d8635e0905ad69
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135443
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2020-02-12 20:01:57 +00:00
Zichang Guo e0621b65b2 [nnbd] Stop writing chunked into headers
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>
2020-02-12 19:36:47 +00:00
Sigmund Cherem 9f4769fd30 [ddc] Add back nullcheck in js_array
Change-Id: I9c32705b97c54b47f03898f0d007a3f07b13e465
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135358
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2020-02-12 19:01:03 +00:00
Joshua Litt e34299101c Add back null check to _StreamIterator constructor in NNBD.
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>
2020-02-12 18:55:47 +00:00
Joshua Litt ad5ee10e69 [dart2js] Migrate a number of trivial libraries to nnbd fork.
Change-Id: I3108823590b41d16a8d0baa25a6760499b2d2f6d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135355
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-02-12 16:43:37 +00:00
Sigmund Cherem 1e6bf61c10 [dart2js] migrate dart:isolate patch
Change-Id: I0387a28c3793431046d7e82c0375117e0f367a1f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135354
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2020-02-11 23:45:10 +00:00
Sigmund Cherem 74f523a186 Add separate libraries.json file to help migrate dart2js libraries.
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>
2020-02-11 22:49:15 +00:00
Srujan Gaddam e2ff83724b Fix nullability for some templates
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>
2020-02-11 20:28:54 +00:00
Vijay Menon b288fc61d6 [isolate/nnbd] fix nnbd errors in dart:isolate
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>
2020-02-11 19:46:34 +00:00
Liam Appelbe 89dc08efe7 [lib] Add null check of types back into _Invocation.method
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>
2020-02-11 18:47:54 +00:00
Alexander Markov dfeb306171 [nnbd/corelib] Restore null test in Stream.asyncExpand
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>
2020-02-11 17:49:24 +00:00
Nicholas Shahan e4c39721c4 [dart2js] Delete dart:mirrors patch file
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>
2020-02-11 17:03:51 +00:00
Nicholas Shahan 855309a1dd [dartdevc] Delete patch files for mirrors library
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>
2020-02-11 17:02:11 +00:00
Alexander Markov 61b2d6a9a7 [nnbd/corelib] Restore null check in DateTime._withValue constructor
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>
2020-02-11 15:38:51 +00:00
Lasse Reichstein Holst Nielsen 76b18c455e Make DoubleLinkedQueue.firstEntry/lastEntry nullable again.
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>
2020-02-11 06:59:11 +00:00
asiva 5fc031ebc1 [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: I3f256526e05299d234cc566c3f05de954deef6ef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135203
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
2020-02-11 01:16:05 +00:00
Nicholas Shahan 905a154f59 Remove import of dart:mirrors from dart:html
This probably should have been part of
https://dart-review.googlesource.com/c/sdk/+/134405 and I suspect it
caused no failures because the import was unused.

Change-Id: I418448ddef5d50267a89ae183f215fded56a425e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134863
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2020-02-11 01:04:55 +00:00
Srujan Gaddam e7ee11a95b Fix input and output for conversions
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>
2020-02-11 00:27:05 +00:00
Alexander Markov 20e20a0c66 [vm/nnbd] Fix lazy _InvocationMirror._type initialization
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>
2020-02-10 23:19:55 +00:00
Srujan Gaddam 5e74472449 Handle optionals in DOM scripts for NNBD
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>
2020-02-10 22:26:35 +00:00
Srujan Gaddam cd53f4ffe1 Add null-safety to html_common
Bug: https://github.com/dart-lang/sdk/issues/37931

Change-Id: I454ffd0cbd090d5f4ff0aa4f2a778710eea7c5b6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133860
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-02-10 19:14:34 +00:00
Srujan Gaddam 9af1ffc558 Don't generate getters/setters for read only promises
Bug: https://github.com/dart-lang/sdk/issues/40530

For attributes that return promises and are read only, we
use promiseToFuture casts that should be maintained.

Change-Id: I02e23fc9c47321ced64a152c245cbdccd7337033
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134902
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2020-02-10 18:55:35 +00:00
Liam Appelbe 661fd081fb [lib] Re-add a null check in Double.toStringAsPrecision
Fixes language_2/double/to_string_as_precision2_runtime_test

Change-Id: I9fa0da0e24f4834cb68fd166c00461d13c3b646b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134920
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
2020-02-10 18:08:04 +00:00
Liam Appelbe b86c6e0ce9 [lib] Fix some NNBD lib tests
Fixes:
lib_2/convert/ascii_test
lib_2/convert/latin1_test
lib_2/typed_data/typed_data_list_test
Change-Id: I493ef6e43db71f09e147b21cbaabdf6a47d833de
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134780
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
2020-02-10 18:06:40 +00:00
Alexander Markov 721035cd3d [vm/nnbd] Fix RangeError in NoSuchMethodError._toStringDeprecated
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>
2020-02-10 17:37:51 +00:00
Mark Zhou 82b73697d7 [dartdevc] Implementing generic function type object equality.
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>
2020-02-10 17:36:14 +00:00
Mark Zhou 4152aa5be2 [dartdevc] Adding support for required named parameters weak mode semantics.
Fixes #39908

Change-Id: I50a567441fdf3928049009a7e6c183223ba91484
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134868
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
2020-02-10 17:26:24 +00:00
Aske Simon Christensen 293c5bec50 Revert "[VM/Libraries] Turn on NNBD versions of dart:io and dart:_http libraries"
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>
2020-02-10 13:44:04 +00:00
Daco Harkes 27385faab5 [vm/ffi] NNBD: Change nullptr type argument to Never
Fixes: https://github.com/dart-lang/sdk/issues/40234

Change-Id: Ib99b6922180d3b13a5042cc4798e57abf6201a12
Cq-Include-Trybots: luci.dart.try:vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64-try,app-kernel-linux-debug-x64-try,vm-kernel-linux-debug-ia32-try,vm-kernel-win-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-kernel-precomp-linux-debug-x64-try,vm-dartkb-linux-release-x64-abi-try,vm-kernel-precomp-android-release-arm64-try,vm-kernel-asan-linux-release-x64-try,vm-kernel-linux-release-simarm-try,vm-kernel-linux-release-simarm64-try,vm-kernel-precomp-android-release-arm_x64-try,vm-kernel-precomp-obfuscate-linux-release-x64-try,dart-sdk-linux-try,analyzer-analysis-server-linux-try,analyzer-linux-release-try,front-end-linux-release-x64-try,vm-kernel-precomp-win-release-x64-try,analyzer-nnbd-linux-release-try,dart2js-nnbd-linux-x64-chrome-try,ddc-nnbd-linux-release-chrome-try,front-end-nnbd-linux-release-x64-try,vm-kernel-nnbd-linux-debug-x64-try,vm-kernel-nnbd-linux-release-x64-try,vm-kernel-mac-debug-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134320
Auto-Submit: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2020-02-10 13:32:54 +00:00
asiva b158bf7bd5 [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>
2020-02-08 21:42:07 +00:00
Robert Nystrom bdfcbe4bf8 Migrate the dart2js dart:collection patch file to NNBD.
Change-Id: I975104fd6257e867693f2374a174aa1082d1d507
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134810
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-02-07 23:28:59 +00:00
Robert Nystrom 63017808b6 Migrate the dart2js dart:math patch file to NNBD.
Change-Id: Ieebc2ccf9a3194fe427dd72fd97eb9b491f2fcc5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134811
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2020-02-07 23:28:48 +00:00
Srujan Gaddam 8c0d72db1d Fix how composedPath is called
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>
2020-02-07 23:25:22 +00:00
Ryan Macnak a73b0ceda2 [vm, lib] Teach mirrors about the Never type and member signatures.
Bug: https://github.com/dart-lang/sdk/issues/12478
Bug: https://github.com/dart-lang/sdk/issues/40497
Bug: https://github.com/dart-lang/sdk/issues/40510
Change-Id: I841d7e239b8235555ec26fbcb74ca41b5de60f58
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134806
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2020-02-07 20:57:46 +00:00
Vijay Menon 05b806ace7 [dartdevc,nnbd] analyze whole sdk, fix isolate errors
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>
2020-02-07 20:50:16 +00:00
Nicholas Shahan 35cd61819a Remove dart:mirrors library from dart2js and ddc SDKs
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>
2020-02-07 17:34:54 +00:00
Alexander Markov c798bd8e53 [vm/nnbd] Fix element type nullability check in _GrowableList.length=
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>
2020-02-07 17:32:24 +00:00
Jonas Termansen 02ced42875 [nnbd] Fix remaining NNBD errors in dart:_http and dart:io.
HeaderValue parameters must have non-null values per the specification.

Bug: https://github.com/dart-lang/sdk/issues/40040
Change-Id: I39f8c894015197c014057888026e4ad474aa5dc8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134722
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Jonas Termansen <sortie@google.com>
2020-02-07 14:31:09 +00:00
Jonas Termansen 514a8d4c84 [nnbd] Fix SecureServerSocket not allowing null SecurityContext.
Bug: https://github.com/dart-lang/sdk/issues/40040
Change-Id: I030f3f6740fd0ffefaa20fac1be69fb74c5cbff5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134293
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Jonas Termansen <sortie@google.com>
2020-02-07 13:36:03 +00:00
Jonas Termansen 7704b83091 [nnbd] Fix Process.stderr providing stdout instead in NNBD dart:io.
Bug: https://github.com/dart-lang/sdk/issues/40040
Change-Id: Ia318180de1b1614502671c6bf4051d79ae7808f3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134327
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Jonas Termansen <sortie@google.com>
2020-02-07 13:33:19 +00:00
Srujan Gaddam dae60008ab DOM script changes to handle nnbd
-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>
2020-02-07 01:05:14 +00:00
Ben Konyi e9e555f4e3 [ VM / Service ] Fix service/developer_server_control_test which was broken after vmservice NNBD migration
Change-Id: Ibbf295b25fbad6cbd9bd0db98ecd6c3ac3eb2eeb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134791
Reviewed-by: Siva Annamalai <asiva@google.com>
2020-02-07 00:45:09 +00:00
Ben Konyi d47391ec41 [ VM / Service ] Fix multiple errors in VM service introduced during NNBD migration
Change-Id: I63ceb4ed94650011d1e0d38ee6f7d2a8e6185c7a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134805
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-02-07 00:11:39 +00:00
asiva f29d9f4fb1 [VM/Libraries] Use the NNBD libraries when building the NNBD sdk.
Change-Id: I06507799f678eeb204fdc8719ef6d97b177cbfd2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134112
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2020-02-07 00:00:07 +00:00
Srujan Gaddam 3776313e65 Change dart:html templates to generate null-safe code
Introduces NULLASSERT token and NNBD condition to allow code to
conditionally compile with NNBD.

Change-Id: Ib71e439f32c793e69b66c328cd7c9900358d886e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134045
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-02-06 23:18:24 +00:00
Robert Nystrom 688801cb27 Migrate language_2/assert to NNBD.
Change-Id: I4daa09afa52f76076374591b3e3f3420a46b169b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134240
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
2020-02-06 22:47:25 +00:00
Ryan Macnak a85f6ec3a1 Fix VM service message routing and asset loading.
Change-Id: I8c36663fd2324e731283ea65dd8a0d3b5e13d55e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134760
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2020-02-06 22:28:04 +00:00