Commit graph

465 commits

Author SHA1 Message Date
David Morgan b59dad38df Revert "[vm/tfa] Convert named and optional parameters to required parameters where possible."
This reverts commit 9ab51b8012.

Reason for revert: Test failure in google3; please see internal b/150195057.

Original change's description:
> [vm/tfa] Convert named and optional parameters to required parameters where possible.
> 
> Flutter Gallery code size (total):
> ARM64: -2.31%
> ARM32: -2.38%
> 
> Change-Id: Ide7764afb06bf6f8387015de612cd4798b301541
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135305
> Reviewed-by: Alexander Markov <alexmarkov@google.com>

TBR=alexmarkov@google.com,sjindel@google.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: Ib198c7cf265384c336d9db6776742db23fb4e999
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/137102
Reviewed-by: David Morgan <davidmorgan@google.com>
Commit-Queue: David Morgan <davidmorgan@google.com>
2020-02-25 15:12:01 +00:00
Johnni Winther 59fcd8d378 [vm] Fix process_patch.dart in sdk_nnbd for Windows
Creating a process with arguments resulted in a late initialization error.

Change-Id: Ibde46da576628a7941fa36042201494ba02eaeda
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136967
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-02-25 11:38:00 +00:00
Vijay Menon 7aa824076c [nnbd/collection] remove incorrect cast
This turned up when we fixed a strong mode bug in DDC (which used to skip this check):

https://logs.chromium.org/logs/dart/buildbucket/cr-buildbucket.appspot.com/8887565601020813776/+/steps/test_results/0/logs/new_test_failures__logs_/0

The casts look incorrect, so removing.

Change-Id: I6ea45e60a84417fa630bb849020e66bd503b1d00
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/137041
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2020-02-25 02:02:20 +00:00
Vijay Menon 279230e898 [dartdevc/nnbd] fix bug in last cl to re-enable warnings
Change-Id: If2729a745c6424151b960a47592924baa1db89ed
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/137044
Auto-Submit: Vijay Menon <vsm@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2020-02-24 23:49:44 +00:00
Liam Appelbe de0805283e [nnbd] Re-add null checks in NNBD SDK file_impl.dart and directory_impl.dart
They were removed here: https://dart-review.googlesource.com/c/sdk/+/133060

Until everyone is migrated, we still need these null checks

This fixes standalone_2/io/file_constructor_test and
standalone_2/io/directory_fuzz_test

Change-Id: I5882ae924d1de0b88f4f0d2012e571fcef697868
Bug: https://github.com/dart-lang/sdk/issues/40614
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135540
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2020-02-24 23:37:43 +00:00
Vijay Menon b5a08c916c [dartdevc/nnbd] fix null checks in primitive casts
These should go through the `cast` operation to fail in strong and pass with warning in weak.

Change-Id: I1863b507835c0c9993357318b9e7038154e47151
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136902
Reviewed-by: Mark Zhou <markzipan@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2020-02-24 21:42:58 +00:00
Zichang Guo 95b2b8c43b [dart:io] Set isDirectory to false for filesystem delete event
According to the `FileSystemEvent` api page, isDirectory should always be false for delete events.

Bug: https://github.com/dart-lang/sdk/issues/35032
Change-Id: Ic277aa366db09c016979350d7369e004f9a8a152
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136405
Commit-Queue: Zichang Guo <zichangguo@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
2020-02-24 17:10:55 +00:00
Alexander Markov 623b3fee52 [nnbd/dart:io] Fix nullability in _EventHandler._sendData
_EventHandler._sendData is assigned to VMLibraryHooks.eventHandlerSendData
and being called using VMLibraryHooks.eventHandlerSendData with null
sender (from timer_impl.dart).

Implementation of _EventHandler._sendData in the VM actually supports
null sender - it explicitly handles null sender at
732cd81f05/runtime/bin/eventhandler.cc (L131-L132)

Given the above, _EventHandler._sendData should take 'Object? sender'
instead of 'Object sender'.

Change-Id: I13a4b11a27e992ecbd27f68da27ea0d568dd0bdb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136782
Reviewed-by: Liam Appelbe <liama@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2020-02-24 16:49:05 +00:00
Samir Jindel 9ab51b8012 [vm/tfa] Convert named and optional parameters to required parameters where possible.
Flutter Gallery code size (total):
ARM64: -2.31%
ARM32: -2.38%

Change-Id: Ide7764afb06bf6f8387015de612cd4798b301541
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135305
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2020-02-24 14:09:27 +00:00
Srujan Gaddam 55f4b1294e Change setProperty to take in nullable |value|
IDL allows |value| to be nullable.

Change-Id: I1db4a7929f0a83c4772e1a11384afb70ead53501
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136722
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2020-02-22 02:22:21 +00:00
Nicholas Shahan d41e419904 [dartdevc] Fix nullability of function types and typedefs
These fixes also prepare for an upcoming change to normalize FutureOr
types.

- Cache and emit the hoisted function type at the top level without
  nullability wrappers.
- Always emit nullability wrappers at the use site.
- Fix issue where sometimes the return type would be double wrapped.

Change-Id: If4a0c94e62eca626f271cc3c259c813911075d9a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136404
Reviewed-by: Mark Zhou <markzipan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2020-02-22 01:20:21 +00:00
Vijay Menon a578c646c3 [dartdevc/nnbd] warn on null param in weak mode
This warns only the first time per (callee/param) location, which reduces the noise significantly.

Change-Id: I9674c366ca38a097fcc93fd2a0716366da57c9d1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136400
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2020-02-22 00:53:51 +00:00
Srujan Gaddam 6d051311b6 Add back in null assertions for legacy weak mode
These assertions need to be added back into the nnbd sdk in order to be
compatible with weak mode.

Change-Id: Ie774fffda1fb0e79dbc7fe13cb75b9d28e4268fd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136720
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2020-02-21 19:13:31 +00:00
Joshua Litt 5aeb1a3f11 [dart2js] Update libraries.yaml with migrated dart2js.
Change-Id: Ibd70ce90d3b965d438a153654efb5e5bff94a201
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135798
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2020-02-21 18:37:40 +00:00
Lasse R.H. Nielsen 98b4635aa9 Make TypeError no longer implement AssertionError.
This means that TypeError no longer inherits a spurious `message` member.
The message of a platform-thrown TypeError is still available as `toString()`.

Fixes #40317

Bug: http://dartbug.com/40317
Change-Id: I77312859ebae3f92c2e56aeea6283b075b71c8d5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136129
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2020-02-21 14:02:57 +00:00
Robert Nystrom 6ef9131d82 Fix the migrated splay_tree.dart to make some casts nullable.
I think the covers the cases where it seems reasonable for the value
being cast to be null. In the other places where I see casts, it's
pretty clear that a null is an error.

Change-Id: I38e9b47da72579e7f3849284689d4c25b5b14af1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136725
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
2020-02-21 02:24:46 +00:00
Srujan Gaddam a42c072017 Remove unnecessary null check in getPropertyValue
CSSStyleDeclaration.getPropertyValue returns a non-nullable string.
It will also return an empty string if the property is not found. Since
getPropertyValue returns the value of the native getPropertyValue, the
null check should be removed.

Change-Id: I9846553d3f9fcd68cbd15b9c39d2104cab594b7a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136413
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2020-02-20 20:49:26 +00:00
Alexander Markov 87f63c3573 [nnbd/vm/corelib] Fixes in VM core libraries for NNBD strong mode
These fixes allow "hello world" to run in NNBD strong mode on the VM.

Change-Id: I3c17b8e1b7ab64086d830298ef8f7601bf1acb68
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136706
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2020-02-20 20:23:25 +00:00
Mark Zhou 2d720be9ef [dartdevc] Adding performance optimizations for common legacy cases.
Changes include:
* Explicitly declaring Type to prevent extraneous type checks.
* Separating null comparison maps from other type comparison maps.
* Hoisting legacy null comparisons outside of isSubtypeOf and into cast.

Change-Id: Ieb2196261998fdaa1d60f0e97223c1d89bf9ad7b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134879
Commit-Queue: Mark Zhou <markzipan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2020-02-20 19:32:36 +00:00
Robert Nystrom 156c503620 Change indexOf() and lastIndexOf() back to Object.
In the legacy SDK these two methods in ListMixin take Object, not E.
When I migrated them to NNBD, I changed them to E to match the
declaration of the methods in List. This was an unintended breaking
change.

Fix that by changing them to "Object?", which is the NNBD equivalent of
the declarations in the legacy SDK.

Change-Id: I2a75e9f26a8198e4f51cb32a55055d5e64a69ed1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136412
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
2020-02-20 09:00:17 +00:00
Mark Zhou f8f6c5d0b2 [dartdevc] Suppressing weak mode errors for functions with required named parameters.
Fixes #39908

Change-Id: I604bfd44d070fbc2f387deb4c9bda31921cb66d5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135206
Commit-Queue: Mark Zhou <markzipan@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2020-02-19 22:27:25 +00:00
Srujan Gaddam 59370f29c5 Fix html methods without returns
Several method bodies did not return a value conditionally or at all.

Change-Id: I01ca87e2e0501597bacb49bcddd10668b59026b0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135626
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-02-19 20:43:34 +00:00
Mark Zhou 691596486b [dartdevc] Adding more warnings when invoking functions missing required named parameters.
Change-Id: I6dd1bcc6f597e2438f5aa7f64a7a9b318bd6e37f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135181
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
2020-02-19 20:18:44 +00:00
Joshua Litt 6c68844821 [dart2js] Two small fixes for building dart2js with the nnbd runtime.
Fix for NoSuchmethod's signature.
Fix for NeverType's scope visitor.

Change-Id: I7d98e37eb7bfcb67339b36d1b335fc4ba9eff6d1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136320
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2020-02-18 23:02:49 +00:00
Vijay Menon b706395788 [dartdevc/nnbd] check parameters in strong mode
Change-Id: I3580c3957729c20facf8d4a78bb32e7cf5573ad6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135320
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-02-18 22:40:10 +00:00
Joshua Litt 4c1a77c2f0 [dart2js] Migrate dart2js rti library to nnbd.
Change-Id: Id38470117a51dc97cbbdcefdb8b31803f013deca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136240
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-02-18 21:21:34 +00:00
Vijay Menon 999eeea5a3 [dartdevc/nnbd] Type fixes uncovered by strong param checking
Change-Id: I86969c021ac2dea28455b40dfdbed8f5923b197e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135797
Commit-Queue: Vijay Menon <vsm@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-02-18 14:22:54 +00:00
Daco Harkes 953377a1fc [vm/ffi] Change internal loads and stores to take no type arguments
Change-Id: Iab7131b5a61282470f339df81b339ceb4fe75962
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136183
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-02-18 12:16:16 +00:00
Daco Harkes 01f4479372 [vm/ffi] Change internal loads and stores to take byteOffesets
Change-Id: Iaff7aa9f158b3b168ccf2d7014a43b08afaa448e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136182
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-02-18 12:16:16 +00:00
Daco Harkes 493779a0e0 [vm/ffi] Size of intptr as getter instead of final field for inlineing
Change-Id: I1bc7ceb06a84e9023c29fdd6255dbfb48c3490fd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136181
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-02-18 12:16:16 +00:00
Daco Harkes 3c9f52a499 [vm/ffi] Fix DynamicLibrary extension name
And add changelog entry.

Follow up of: https://dart-review.googlesource.com/c/sdk/+/135463

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

Change-Id: I877f735c54e466031715c775d37544617402f9ff
Cq-Include-Trybots: luci.dart.try:vm-ffi-android-debug-arm-try,vm-kernel-nnbd-linux-release-x64-try,analyzer-linux-release-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136124
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-02-17 14:55:25 +00:00
Joshua Litt 374c9c448f [dart2js] Migrate most remaining js_runtime files to nnbd.
Change-Id: I2feb5a30f59df926ea9a9701ef1d82fcbf457fbf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135960
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-02-16 18:52:34 +00:00
Zichang Guo 361f881b8e fix nnbd websocket
This fixes web_socket_typed_data_test and web_socket_test

Change-Id: I7200ba423dbe24857854ba600f9fb9b3d4757635
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135620
Commit-Queue: Zichang Guo <zichangguo@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2020-02-15 03:40:00 +00:00
Mayank Patke 174c4323ca [dart2js] Fix isLegacyObjectType in RTI.
Looks like this got mixed up due to a bad rebase/merge.

Change-Id: I566acf5a84755cb26fb7b3283a227196cce68d4b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136061
Auto-Submit: Mayank Patke <fishythefish@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2020-02-15 00:56:50 +00:00
Zichang Guo d39cdf03f8 Reland [dart:io] Stop forcing lower case on HttpHeaders
This is a breaking change. Request: https://github.com/dart-lang/sdk/issues/33501

HttpHeaders use lowercase by default for all headers, since it is supposed to be case insensitive. Some servers incorrectly treat case as significant, however, and expect headers with capitalization or in uppercase. The current implementation forces headers to be lower cases when adding values. Users cannot even manually modify the headers.

This change removes this restriction here so that users can modify the headers to whatever form they want. The new behavior is backwards compatible except if class was implemented. All headers inside http.dart are written as lower cases, adding values to HttpHeaders is still receiving lower cases input.

The other cl (https://dart-review.googlesource.com/c/http_multi_server/+/121411) migrates multi_headers.dart to be compatible with this change.

Bug: https://github.com/dart-lang/sdk/issues/33501
Change-Id: Ieb9f4061b27ed3bbc6d82e6a408c77d11abb037b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135357
Commit-Queue: Zichang Guo <zichangguo@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2020-02-14 22:23:17 +00:00
Joshua Litt 02c2082c62 [dart2js] Fix for trivial NNBD compiler issues
Change-Id: I44a890d0a62bd404ef2147e28c849401a2dae3bc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135760
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-02-14 19:20:37 +00:00
Liam Appelbe 4c9bf71bb2 [lib] Re-add null check in invocation_mirror_patch
This fixes vm/cc/IsolateReload_TearOff_AddArguments

Change-Id: I8820b8b4a4ce83b819b36fb03220b7b5099bc888
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135780
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
2020-02-14 18:56:47 +00:00
Sigmund Cherem 0a1e9f6ef0 Undo breaking change in dart:js_util
Change-Id: Idfb8d15310c01cfebe6ab9200dfec7c96fe3040d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135793
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2020-02-14 18:36:18 +00:00
Joshua Litt 494f822c70 [dart2js] Migrate core to nnbd.
Change-Id: I96dbe62334ab4b37b0ae758908192bb8610b5694
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135487
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-02-14 16:39:47 +00:00
Nicholas Shahan 29c9658c51 [dartdevc] Map bottom type to Null in legacy libraries
Fix instance checks for types that are internal to the type system.

Fixes: #40610
Change-Id: I0c6c1bb4d64f25a97c53bd64a3940cf3e9f45c88
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135580
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2020-02-14 16:16:07 +00:00
Daco Harkes c1467ab5d3 [vm/ffi] Change asFunction and lookFunction to extension methods
This prevents them from being called dynamically.
Moreover, it prevents asFunction from being called on a non-NativeFunction type argument, simplifying the amount of manual checks.

Note that this CL had to change the CFE and analzyer, and their tests (including mock_sdk) as well.

This can potentially be a breaking change, as the extension methods are only visible when `dart:ffi` is imported, while methods on objects are always visible.

Issue: https://github.com/dart-lang/sdk/issues/35903

Change-Id: I1e291f154228d5d9a34b21a022088bf493f6557d
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,vm-kernel-mac-debug-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
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135463
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-02-14 15:46:37 +00:00
Mayank Patke 989180af3e [dart2js] Add normalization to RTI.
Change-Id: Ieecb90fbc6fdf13a44373d285fc5da450a9876b3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134960
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-02-14 01:59:12 +00:00
Mayank Patke 573f470615 [dart2js] Represent nullability as a field.
Change-Id: I12f4c7acfa294b0e92d3f94f7099ffa2aa9cc0a1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134792
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-02-14 01:59:12 +00:00
Joshua Litt c894118574 [dart2js] Migrate js patch file to NNBD.
Change-Id: I51296bd310c5ce902483253656acf07263d9244b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135486
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-02-14 00:03:27 +00:00
Joshua Litt 93bb4b0f1b [dart2js] Migrate a couple of trivial libraries to nnbd.
Change-Id: I5940b3ec3d322cabd41b68ccc128054041891b88
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135485
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-02-13 19:40:40 +00:00
Joshua Litt 166edab750 [dart2js] Migrate developer patch file to nnbd.
Note: This is mostly just the DDC developer patch file.
Change-Id: I98277304b2fbe8fa939dc7e6fb4bd9e0c199b2b0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135535
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-02-13 18:37:38 +00:00
Sigmund Cherem f1d715b4d6 [dart2js] migrate dart:_interceptors and dart:internal patch files
Change-Id: I54b81401c94c866770c492f818e76dcf6d40868f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135488
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2020-02-13 02:16:57 +00:00
Nate Bosch 43bbf73da3 Update doc comments for dart:js_util
- Format consistently with a header sentence.
- Use `JavaScript` over `JS`, and surround references to the `@JS()`
  annotation with backticks.
- Drop the word "efficiently" since it isn't true of the more commonly
  used API `jsify`.
- Add a note about preferring `@anonymous` interop classes over `jsify`
  with a map.
- Remove mention of `JsObject` since this isn't what gets returned.
- Clarify that Dart objects can't be used from JavaScript, this is
  mentioned at the library level but it worth repeating on `jsify`.

Change-Id: If7582db6440d96f20bb5b4e11bcc0ffe047d9d0a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135525
Commit-Queue: Nate Bosch <nbosch@google.com>
Reviewed-by: Kathy Walrath <kathyw@google.com>
2020-02-13 01:41:41 +00:00
Zichang Guo fb7e6ba494 fix nnbd http parsing bug for http_headers_test
This fixs part of http_headers_test. The rest is because HeaderValue becomes non-nullable(in this cl https://dart-review.googlesource.com/c/sdk/+/134722).

Change-Id: Id1aad86363564986dba5282a9983924252ae0ecb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135530
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Zichang Guo <zichangguo@google.com>
2020-02-13 00:49:29 +00:00
Joshua Litt cefd113de2 [dart2js] Migrate convert to nnbd.
Note: This is the DDC convert patch.
Change-Id: I4dbdcc146756a32ddfc12c5bf9e0cc1592f40b69
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135442
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2020-02-13 00:14:27 +00:00
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