Commit graph

20641 commits

Author SHA1 Message Date
Zichang Guo 4489805956 Revert "[dart:io] Fixes the FileIO performance regression"
This reverts commit ba25fd190e.

Reason for revert: It broke dart2js. https://logs.chromium.org/logs/dart/buildbucket/cr-buildbucket.appspot.com/8878578963299042720/+/steps/build_dart/0/stdout?format=raw.
Unimplemented handling of missing static target.

Original change's description:
> [dart:io] Fixes the FileIO performance regression
> 
> Previous CL (https://dart-review.googlesource.com/c/sdk/+/139881) causes
> performance regression.
> 
> Improves:
> FileIO_readwrite_512kb: 196.5%, 224.1%
> FileIO_readwrite_verify_512kb: 38.28% 46.71%
> 
> 
> Change-Id: I5fb7752f14a2b39238e82bf45b059fe145b9087f
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148563
> Commit-Queue: Zichang Guo <zichangguo@google.com>
> Reviewed-by: Martin Kustermann <kustermann@google.com>
> Reviewed-by: Jonas Termansen <sortie@google.com>

TBR=sortie@google.com,kustermann@google.com,zichangguo@google.com

Change-Id: I170eeed56484f2ece3c3b7f1b93f54edf5ae2736
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149743
Reviewed-by: Zichang Guo <zichangguo@google.com>
Commit-Queue: Zichang Guo <zichangguo@google.com>
2020-06-02 19:14:05 +00:00
Zichang Guo ba25fd190e [dart:io] Fixes the FileIO performance regression
Previous CL (https://dart-review.googlesource.com/c/sdk/+/139881) causes
performance regression.

Improves:
FileIO_readwrite_512kb: 196.5%, 224.1%
FileIO_readwrite_verify_512kb: 38.28% 46.71%


Change-Id: I5fb7752f14a2b39238e82bf45b059fe145b9087f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148563
Commit-Queue: Zichang Guo <zichangguo@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
2020-06-02 17:47:05 +00:00
Robert Nystrom 9d6fd6e25d Migrate language_2/metadata to NNBD.
Change-Id: I0243e6112ea3dc31e69a2c1395e08575ab5cb276
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149561
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2020-06-02 16:45:26 +00:00
Robert Nystrom e1ece8fcbc Migrate language_2/malformed to NNBD.
Change-Id: I5680d43fd7128ea3c8d95d86bf62bbb21f4273a9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149489
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2020-06-02 16:41:11 +00:00
Johnni Winther 665c58aa1a [cfe] Disallow void in await expression
Closes #41602

Change-Id: I29b8880e3fdb769b2acdf2c82a9ced038d7b0d94
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149287
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-06-02 08:20:31 +00:00
Jens Johansen 0f94cff912 [dartk] Mark regress41983 as slow on debug reload bot; copy test to language too
Fixes https://github.com/dart-lang/sdk/issues/42051

Change-Id: I7d40f3d2c86acf76ee6c7251b45480aef72228b7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149425
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2020-06-02 07:29:31 +00:00
Kevin Moore 407428311f Remove extension method opt-in in many language tests
Change-Id: I277a4f29d39c2c4d2669931b5f4837db65589167
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149522
Auto-Submit: Kevin Moore <kevmoo@google.com>
Commit-Queue: Leaf Petersen <leafp@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2020-05-31 18:46:23 +00:00
William Hesse d3959945f7 Skip unicode surrogate test on android
This test crashes the android test runner, and should be fixed
when issue https://github.com/dart-lang/sdk/issues/42094 is rolled
to the checked-in SDK.

BUG=https://github.com/dart-lang/sdk/issues/42094

Change-Id: I91e5ea5358b08d3776ae485b90aff7cd01d02322
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149580
Reviewed-by: William Hesse <whesse@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-05-30 23:29:02 +00:00
Robert Nystrom 0429dda6d2 Migrate language_2/map to NNBD.
Change-Id: I7567d8f705b84a286e4091ece850ccbf5966e6b7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149490
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
2020-05-30 01:39:28 +00:00
Robert Nystrom 0cc78c340e Migrate language_2/library to NNBD.
Change-Id: I59b0b611c2e7a6cf779eb1c1df7ceb0d199e88be
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149390
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
2020-05-30 01:10:44 +00:00
Robert Nystrom 1b8f589d3c Migrate language_2/least_upper_bound to NNBD.
Change-Id: Id1cffba25214323478af50a8ae539236377d53c6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149047
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2020-05-30 00:55:26 +00:00
Srujan Gaddam 319ae89bec [package:js] Filter out tests on CSP that use eval
Closes https://github.com/dart-lang/sdk/issues/42085

Tests that use eval rely on injecting JS code which will fail on
CSP try bots and therefore should be skipped by design.

Change-Id: I4d1299b1315817c38da61f572c59d95f505db0d1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149541
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2020-05-30 00:14:48 +00:00
Robert Nystrom 3218ba8412 Migrate language_2/loop to NNBD.
Change-Id: Id8fee2221036b8dca12675ba3e4fc1c0ab7a09b7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149393
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
2020-05-29 23:48:57 +00:00
Mark Zhou 7bc496951e [dartdevc] Fixing issue whereby async generators would not resume properly after yielding from within a catch block.
Presubmits at cl/297164263

Fixes #39994

Change-Id: I2fff5db716f1b3e4f125ec9ae5f018a7edbbed67
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136846
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
2020-05-29 20:37:06 +00:00
Robert Nystrom 359023d699 Migrate language_2/is to NNBD.
Change-Id: I915bc1adde6ef377a5043aab07ba0519cc03164f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149040
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
2020-05-29 19:47:44 +00:00
Robert Nystrom 39fbdcd2c9 Migrate language_2/inference to NNBD.
Change-Id: Iea8e8826b41d3996916dd24153ab846ef49eeda4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148945
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2020-05-29 19:24:14 +00:00
Robert Nystrom 89c7c0b6e0 Migrate language_2/lazy to NNBD.
Change-Id: Icd7ea40455f207eca1dc817ff86823cfabed3de0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149042
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2020-05-29 19:23:24 +00:00
Robert Nystrom 8680ff91e2 Migrate language_2/main to NNBD.
Change-Id: I902365b92bba4b84159375bda9243012f009c16d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149394
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
2020-05-29 19:15:34 +00:00
Alexander Thomas 42c3d21756 [infra] Run all migrated co19 tests on nnbd configurations
co19 test migration has started, and these tests will be unskipped
folder by folder now.

Change-Id: I7dad1a97d1a676042512a8a19e1403849e039f97
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149002
Reviewed-by: William Hesse <whesse@google.com>
2020-05-29 11:35:04 +00:00
Erik Ernst f585be5af2 Update language/invalid_returns tests, cf. SDK #41803
Change-Id: I36661c955b9e033fce92481033307525028a5dc3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149163
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2020-05-29 08:07:18 +00:00
Nicholas Shahan 72e559929f [ddc] Add --sound-null-safety flag and pass to CFE
https://dart-review.googlesource.com/c/sdk/+/149080 is required to
get errors if you try use weak .dill files when passing the
--sound-null-safety flag.

Added a new build target to copy the sound SDK outline .dill to
dart-sdk/lib/_internal. This is only part of dartdevc_test right
now. We will decide in the future if we are going to include this
in the released SDK or if we will have the build systems create
them as needed. For now in testing scenarios it appears to be part
of the SDK.

Change-Id: I3b31a894841f59b437658104e7ee9443ee67db93
Fixes: https://github.com/dart-lang/sdk/issues/41694
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146962
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-05-29 01:16:18 +00:00
Joshua Litt 107862e2bf [dart2js] Fix bug in modular_test_suite.
Change-Id: I37954e14e8b53e70e0cfc4c3bcfb216e9f4d482f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148000
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-05-28 21:30:36 +00:00
Robert Nystrom 1ab2d95105 Migrate language_2/implicit_downcast_during to NNBD.
Change-Id: Ie6631ecd6e597c09ef7e7a94709c3e4d9587e1a6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148286
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2020-05-28 18:59:48 +00:00
Joshua Litt 20faaa5d94 [dart2js] Move dart2js unit tests to pkg/compiler/test.
Change-Id: Ib18f554c1076f27a3f7c0df5a36410da41a1f467
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148784
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-05-28 18:51:11 +00:00
Alexander Thomas b718209dfd Revert "[co19] Enable tests migrated to null-safety"
This reverts commit 9a588de9f4.

Reason for revert: The tests need additional fixes before they can be enabled, and this CL makes it harder to land the support for running
the tests on tryjobs.

Original change's description:
> [co19] Enable tests migrated to null-safety
> 
> Change-Id: I738f5be6fe60aa4addb925101eb7f2912627ec8b
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148527
> Reviewed-by: Sergey Grekhov <sgrekhov@unipro.ru>
> Reviewed-by: William Hesse <whesse@google.com>
> Commit-Queue: William Hesse <whesse@google.com>

TBR=whesse@google.com,athom@google.com,sgrekhov@unipro.ru

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

Change-Id: If758a0041214693aa6cd90f76b3e1a4f4db78c5b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149283
Reviewed-by: Alexander Thomas <athom@google.com>
2020-05-28 09:42:56 +00:00
Sigmund Cherem 521acb17e4 [dart2js ddc] make paths of dart2js and ddc platform files agnostic of nnbd.
Our platform .dill files show machine agnostic paths of the form:

  org-dartlang-sdk:///sdk/lib/foo/

and with the unfork:

  org-dartlang-sdk:///sdk_nnbd/lib/foo/

This change makes the path agnostic of the sdk_nnbd sources as well:

  org-dartlang-sdk:///lib/foo/

So that source-mapping tools can find the sources if needed (our sdk_nnbd vs sdk
is not visible on published sdks).

Fixes https://github.com/dart-lang/sdk/issues/41949

Change-Id: Iceea8a917fb9a6e5f305d22ba6ee0927354d4d8f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148881
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2020-05-28 00:31:13 +00:00
Srujan Gaddam df36449d72 [package:js] Add JS test for function parameters
Adds tests for JS objects with functions with positional and
optional parameters. It does not include named arguments as those
should be statically disallowed.

Change-Id: I24acadc8160d3515bb79b00dc6ab28b528e2b039
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148221
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-05-28 00:00:04 +00:00
Konstantin Shcheglov 765cdc169c Update language/interface/interface2_test after analyzer changes.
Bug: https://github.com/dart-lang/sdk/issues/42076
Change-Id: Ia2d4d42540a702301c76ef35e05a9c86e2cee3d3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149220
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-05-27 19:07:20 +00:00
James Lin 10e8d5d1a6 Try to clarify the RangeError.range message
The old RangeError.range message was confusing:

  RangeError (index): Invalid value: Not in range 0..2, inclusive: 9

The comma makes the message hard to parse.  I've seen a number of
people misinterpret "inclusive" as describing the invalid value (9)
instead of acting as a modifier on the range.

https://github.com/dart-lang/sdk/issues/29586 has a lot of
bikeshedding about this, but in the interest of mitigating confusion
sooner, I propose changing it to:

  RangeError (index): Invalid value: Not in inclusive range 0..2: 9

I'm intentionally trying to improve the message with minimal
disruption to the structure of the error message.  Although I'd much
prefer that "Invalid value" and the actual value be adjacent instead
of being interrupted by the explanation, such restructuring is rather
non-trivial.  RangeError allows the "Invalid value" message to be
customized, and rearranging terms could produce even worse
constructions.

I also considered:

  RangeError (index): Invalid value: Not in range [0, 2]: 9

And while I like that that is brief and clear, I chose not to use it
for people who are unfamiliar with interval notation and who might
mistake it as a Dart List.

Bug: https://github.com/dart-lang/sdk/issues/29586
Change-Id: I0f23b195437e4053ae5f76b5d303123979a8c9fe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146024
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2020-05-27 14:59:39 +00:00
Mayank Patke bbb8923ebb [dart2js] Ensure all top/raw type predicates go through DartTypes.
Conceptually, this makes sense because a type is not intrinsically top
or bottom or raw, but only in the context of a type system. This also
makes these predicates much more maintainable and puts them in a form
identical to the one at the RTI level.

Change-Id: I83154a82cef6cbaa9c4d0f27cb95f01473c1e015
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149049
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2020-05-27 05:28:03 +00:00
Mayank Patke d1546cac87 [dart2js] Make diagnostic message arguments strongly typed.
We were passing arguments as just a `Map` and forcing the Message to
handle the String conversion, but the caller is much better equipped to
do it and prevents the dynamic typing.

Change-Id: Icc4ab91edf233b81a64aa3b03462b541349fa751
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149048
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-05-27 05:28:03 +00:00
Mayank Patke 570de5884f [dart2js] Run some units tests in weak mode.
If we don't pass the flag explicitly, the code in these tests will be
compiled in NNBD strong mode due to the language version of the
entrypoint.

Change-Id: Id6ed574ad932cf7fb6d9681e1d514e79fb3cbe04
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148647
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
2020-05-26 22:08:52 +00:00
Konstantin Shcheglov 571f564eda Rewrite TypeName to ConstructorName in one place, consolidate error reporting.
Change-Id: I5ea1369d65c5eb47e920f68806d28f34931d372e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148983
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-05-26 21:32:22 +00:00
Robert Nystrom a25ee6adc5 Migrate language_2/label to NNBD.
Change-Id: I9ec3a68c392c533ed9e766b1233ea9a672a9f5cc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149041
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
2020-05-26 20:56:30 +00:00
Robert Nystrom 3b646d61d5 Migrate language_2/initializing_formal to NNBD.
Change-Id: I464f1209211d5eaf99395d2d4825467e9cf574a0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148947
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2020-05-26 18:54:20 +00:00
Robert Nystrom 507ebbf31f Migrate language_2/interface to NNBD.
Change-Id: I6fd1568fd24c0ae1ad3a6f6922cc4ece1b11d35b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148952
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
2020-05-26 18:52:50 +00:00
Robert Nystrom d3ef98ea3b Migrate language_2/instance to NNBD.
Change-Id: I058f81e4af6e962b2620810dbfe75c7ac86b9d11
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148948
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
2020-05-26 18:35:20 +00:00
Robert Nystrom d35702e83a Migrate language_2/import to NNBD.
Change-Id: I95d0545c17bd0755424c50f3c5c5f8b89b8c01de
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148944
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
2020-05-26 18:26:00 +00:00
Alexander Markov 572905d1e9 [vm] Fix crash in disassembler on trampolines
Fixes https://github.com/dart-lang/sdk/issues/42017

Change-Id: I7d9f2694907be2ba673f35c82ce65a4ee8bc77b6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148942
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-05-26 17:31:58 +00:00
Robert Nystrom 9c2075be49 Migrate language_2/interceptor to NNBD.
Change-Id: Ibbc89b68ef980e1ff9913c299c05d5117b249477
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148949
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2020-05-26 16:04:15 +00:00
Jens Johansen 4dcf24ac7f [CFE] Use BlockExpression for encoding cascades
Change-Id: I9c56cbed9880716af804c80c6ca34578ae6765a4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148528
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigurd Meldgaard <sigurdm@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2020-05-26 09:07:25 +00:00
Tess Strickland 826576dcfc [vm] Store relocated addresses for text sections in BSS.
The relocated addresses are populated during BSS::Initialize() for
natively loaded ELF snapshots, and during the non-native loader when it
is used. Putting this information in the BSS segment avoids having to
change the embedder interface, since we only need this information for
AOT snapshots. This also avoids depending on our ELF snapshot layout
to reverse-engineer the DSO base for ELF-compiled snapshots.

We now always print the DSO base for both the VM and isolate in
non-symbolic stack traces, not just for ELF-compiled snapshots. However,
we still only print the relocated addresses in individual stack frames
if we're guaranteed they match those in separately saved debugging
information.

Bug: https://github.com/dart-lang/sdk/issues/41880

Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-linux-product-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-win-release-x64-try,vm-kernel-precomp-mac-release-simarm64-try
Change-Id: I4837262f78e6e73a32eb7e24ef7a68ccb8ec2669
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148441
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-05-26 08:47:30 +00:00
Alexander Thomas 391aa52fe4 [test] Skip flaky canvasrendering tests in Chrome on Mac
These tests alternative between Pass and RuntimeError, but somehow
aren't detected as flaky automatically.

https://github.com/dart-lang/sdk/issues/42048

Change-Id: Icb558f4f8e7c38baae0b8f3d721b69cad9db2c80
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149001
Commit-Queue: Alexander Thomas <athom@google.com>
Commit-Queue: William Hesse <whesse@google.com>
Auto-Submit: Alexander Thomas <athom@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2020-05-26 08:38:55 +00:00
sgrekhov 9a588de9f4 [co19] Enable tests migrated to null-safety
Change-Id: I738f5be6fe60aa4addb925101eb7f2912627ec8b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148527
Reviewed-by: Sergey Grekhov <sgrekhov@unipro.ru>
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: William Hesse <whesse@google.com>
2020-05-25 08:26:38 +00:00
Ben Konyi 65113fd73d Reland "[ VM / DartDev ] Fix issue where EXEUtils returned a relative directory path instead of an absolute path"
This reverts commit c0976b6037.

Change-Id: I17e9b3087ba1e65bf64053011200e4df43c90a44
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148943
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-05-22 01:55:52 +00:00
Leaf Petersen 96c23be456 Add tests for runtime type normalization.
Change-Id: Ie71fa6acc1317d6be33cfb45ffed1a0816020806
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148582
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2020-05-21 23:04:45 +00:00
Robert Nystrom 114eea60bb Skip mixed-mode tests under language/nnbd in strong mode.
These tests all are or import legacy libraries, so are no longer
supported in NNBD strong mode. Adding Requirements=nnbd-weak tells the
test runner to skip that test when running in strong mode.

I deleted mixed_bottom_type_strong_test.dart entirely since it seems to
be specific to strong mode but is a legacy library. It is no longer
meaningful and there is already a corresponding weak test.

Change-Id: I5a8ec93114ad29abc3d12e356eeb7bf9efd3e1c4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148234
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
2020-05-21 17:34:43 +00:00
Robert Nystrom 4c78bacd1d Migrate language_2/implicit_creation to NNBD.
Change-Id: I4b287ab1f1160550682a6afb706f5985b9fb474d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148282
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
2020-05-20 22:04:05 +00:00
Ben Konyi c0976b6037 Revert "[ VM / DartDev ] Fix issue where EXEUtils returned a relative directory path instead of an absolute path"
This reverts commit af5ad5f1b0.

Reason for revert: Failing Windows bots.

Original change's description:
> [ VM / DartDev ] Fix issue where EXEUtils returned a relative directory path instead of an absolute path
> 
> This was causing the DartDev snapshot discovery to fail for brew
> installs as the last symlink resolved to '../libexec/bin/dart' which
> meant that we were looking for the snapshot at
> '../libexec/bin/snapshots/dartdev.dart.snapshot'.
> `
> 
> Change-Id: Ic68bfa13ba060f7a059d07e25c04076583b0b118
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148542
> Commit-Queue: Ben Konyi <bkonyi@google.com>
> Reviewed-by: Siva Annamalai <asiva@google.com>

TBR=bkonyi@google.com,asiva@google.com,zichangguo@google.com

Change-Id: I55d3102e87c4cc522bac3a55421ed85f22f97035
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148745
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-05-20 19:36:42 +00:00
Ben Konyi af5ad5f1b0 [ VM / DartDev ] Fix issue where EXEUtils returned a relative directory path instead of an absolute path
This was causing the DartDev snapshot discovery to fail for brew
installs as the last symlink resolved to '../libexec/bin/dart' which
meant that we were looking for the snapshot at
'../libexec/bin/snapshots/dartdev.dart.snapshot'.
`

Change-Id: Ic68bfa13ba060f7a059d07e25c04076583b0b118
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148542
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2020-05-20 18:59:05 +00:00
Mark Zhou 9807b83d59 [dartdevc] Restricting late hot restart tests to static and top-level fields.
Change-Id: I1f9dc8c18ff17d2a09d69e4afb235cb4b57036bc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148687
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
2020-05-20 03:14:01 +00:00
Zichang Guo cdc98a045f [dart:io] Support abstract unix domain socket on Linux
Abstract unix domain socket(UDS) is not supported on platforms other
than Linux/Android. So it has not been supported in the initial design.

This cl will enable users to use abstract UDS.

As long as InternetAddress has a path starting with '@', it will be
interpreted as abstract UDS on Linux/Android.

For abstract UDS, checkout unix man page for more information.

Bug: https://b.corp.google.com/issues/156871566

Change-Id: I393d798b2fc65304677a60639223f90e20aabaa3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148380
Commit-Queue: Zichang Guo <zichangguo@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2020-05-19 21:33:10 +00:00
Zichang Guo efabc6f848 [dart:io] Fixes _HttpHeaders forcing lowercased Header fields.
Outgoing HttpHeaders will use _build() to build headers. This cl make
_build() uses case-sensitive HttpHeaders.

Original change's description:
> [dart:io] Preserve header case in http header _builds()
>
> Bug: https://github.com/dart-lang/sdk/issues/33501
> Change-Id: I57d9bba251b76314bf40b81d1b09bd4643dce4d2
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/141911
> Commit-Queue: Zichang Guo <zichangguo@google.com>
> Reviewed-by: Siva Annamalai <asiva@google.com>
> Reviewed-by: Jonas Termansen <sortie@google.com>

Bug: https://github.com/dart-lang/sdk/issues/33501
Change-Id: I2d42351b9593d86ad1b2ea248faaea625d321e96
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/143081
Commit-Queue: Zichang Guo <zichangguo@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2020-05-19 19:24:08 +00:00
Regis Crelier 19f49509b0 [VM/nnbd] The equivalent of dynamic as bound is Object? and not Object.
This is a partial fix for https://github.com/dart-lang/sdk/issues/41939

Let's take one step at a time, but later, we should be able to leave the bound as dynamic, since mutual subtyping of bounds is now implemented.

Change-Id: I57f725ba5b02237a64ae77593f340438f7159ab7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148515
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
2020-05-19 18:10:54 +00:00
Mayank Patke f80517d38a Migrate language/regress/regress41890_test to use isStrongMode/isWeakMode from package:expect.
Change-Id: Ic0619b4df2a9e06ccea80bc7500450aed980e218
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148508
Reviewed-by: Stephen Adams <sra@google.com>
2020-05-19 06:55:30 +00:00
Zichang Guo 8fb7471017 [dart:io] Reset _connecting when socket connects failed
_connecting doesn't get updated when socket connects failed, which will
block all following connect() from the same HttpClient().

Bug: https://github.com/dart-lang/sdk/issues/34477
Change-Id: I9c24a75efb5ef90b2dc1af65b9efb8ed45a71699
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/147688
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Zichang Guo <zichangguo@google.com>
2020-05-18 19:39:07 +00:00
Daco Harkes 40f7a11d89 [vm/ffi] NNBD use external fields for structs
This enables adding the `external` keyword to struct fields, which
enables use in nnbd (weak mode).

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

External fields are not implemented in the analyzer yet:
https://github.com/dart-lang/sdk/issues/41940

Change-Id: I9d88acbdabf73ca63a6ad3d549930aa3c97cb53f
Cq-Include-Trybots: luci.dart.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-precomp-nnbd-linux-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148242
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2020-05-18 12:22:50 +00:00
Clement Skau 674af7e93f [VM] Optimise nested _SyncIterator to avoid deep recursion.
Benchmarks (AOT):
- RunTime as Score (bigger is better):
  - Iteration.deeptree.syncstar(x64): +3450%
  - Iteration.concat.syncstar(x64): +28%

Note: Some other benchmarks (notably ForInGeneratedLoop) are to a
lesser degree negatively impacted since they use sync* in a way
that incurs the overhead without being able to see any of the benefit.

Bug: https://github.com/dart-lang/sdk/issues/37753
Change-Id: I003375ed5104623884bc1cf9c745ba992d0879c1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144943
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-05-18 08:51:34 +00:00
Konstantin Shcheglov 08bad91aa3 Fix for crash 'C?.foo'.
Change-Id: I9e03b056c9df6c476de7fa29f412c1704d6c3185
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148183
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-05-18 02:43:47 +00:00
Joshua Litt ceee64500f [dart2js] Delete obsolete type_representation_test.
Change-Id: Ide28688e2977cbc218f9a69fd4f76c3497afefa4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148228
Auto-Submit: Joshua Litt <joshualitt@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2020-05-16 00:09:22 +00:00
Mayank Patke 22e5856ae5 [dart2js] Normalize the FlatTypeMask representation of Null.
Change-Id: I8362f9fd4373fc64d2125602d35e8f7612081a93
Fixes: https://github.com/dart-lang/sdk/issues/41867
Fixes: https://github.com/dart-lang/sdk/issues/41918
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148182
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2020-05-15 21:45:12 +00:00
Joshua Litt 42a1f29d5b [dart2js] Minor tidying up of unittests.
Change-Id: If0d6866601ea06a0b167a1a23127257e38828935
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148227
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2020-05-15 20:19:52 +00:00
Joshua Litt 53c77e7a16 [dart2js] Fix for nnbd type_substitution_test.
Change-Id: I5d1db538e1c0e39c9463ffd6e581ed54fd23059f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145304
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2020-05-15 20:17:52 +00:00
Robert Nystrom 02b50e4079 Migrate language_2/if_null to NNBD.
Change-Id: Idf369ab6b6ff6784719924fdcc7c586001a285e4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148204
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2020-05-15 19:13:43 +00:00
Robert Nystrom 1d87f8e384 Migrate language_2/identifier to NNBD.
Change-Id: If2883e339658bf6a8bb34a9aead689fc7697df4f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148146
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2020-05-15 18:47:52 +00:00
Robert Nystrom e11cac8d8b Migrate language_2/identity to NNBD.
Change-Id: Ie2940ca89811d02cb9b51cb7ea1fc939c872d149
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148147
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
2020-05-15 18:05:02 +00:00
Robert Nystrom c8674d581e Migrate language_2/if to NNBD.
Change-Id: Ia481e2305a2a946876fc8a2dd6fd2e7c333da3fd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148149
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
2020-05-15 16:00:12 +00:00
Joshua Litt f36ea511be [dart2js] Fix mixin_typevariable_test for nnbd.
Change-Id: Iefa7b0a36508fe421db7bb93b042b3c9ca64676c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145280
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2020-05-14 23:38:35 +00:00
Joshua Litt dc1d7c8720 [dart2js] Port function_type_variable_test to nnbd.
Change-Id: I180bc39c468bb923345ad0537a45409fdeb6c47a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146692
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2020-05-14 22:29:45 +00:00
Robert Nystrom 415cab79d3 Migrate language_2/getter to NNBD.
Change-Id: Ibe4be604f5002c125aba64c051793b750f31638a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/147819
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2020-05-14 19:16:39 +00:00
Johnni Winther 46963a3422 [cfe] Change implicit catch type to Object
Closes #41520

Change-Id: Iff07ac2b7187b042e2c702462c0c3269208f27ed
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148062
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-05-14 18:26:01 +00:00
Jonas Termansen 2676764792 [dart:io] Fix late localAddress initialization in non-socket errors.
An oversight was made in the dart:io null safety migration where it
wasn't noticed that errors on non-TCP/non-UDP native sockets would read
the late localAddress field that would never be initialized. This
condition can happen for e.g. pipes to other processes where an error
would cause a LateInitializationError instead of a SocketException.

This changelist fixes the problem by making sure the field is never read
except on TCP and UDP sockets, and furthermore statically ensures the
field is always initialized for TCP and UDP sockets.

A regression test is added to reproduce the problem and to confirm it is
indeed fixed by this changelist.

Bug: https://github.com/flutter/flutter/issues/57125
Change-Id: I18f65d94d905d2990afc72e33ce25bda8211606e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148063
Commit-Queue: Jonas Termansen <sortie@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2020-05-14 12:41:27 +00:00
Stephen Adams e0257265d3 [dart2js] Fix for #41890
- Use JS inline code instead of '%' in assertion (#41890)

Other changes help code work without inlining or type inference

- Use annotation to ensure isTopType has no entry check.
- Use JS_STRING_CONCAT instead of '+'.

Fixed: 41890
Change-Id: I1958f1ebbb6049a350fad07a975e8e851db2b115
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148006
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2020-05-14 06:17:56 +00:00
Robert Nystrom b4d17e9c07 Migrate language_2/generic_methods to NNBD.
Change-Id: I3ec18bb7e7cfb087a58d744d357bf004c0438ba9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/147813
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2020-05-14 01:41:56 +00:00
Mark Zhou 17efd72778 [dartdevc] Adding hot restart tests for late and lazy fields.
Change-Id: I7016cc98a0f751dbf001e16cabf3a2806b958109
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/147981
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
2020-05-13 22:39:03 +00:00
Robert Nystrom d6fed1f624 Add support for web static error tests to TestFile and StaticError.
This enables parsing and validation for tests that contain:

    //     ^^^
    // [web] Some web-specific error.

This doesn't run those tests on DDC and dart2js yet, and the test
updating tool doesn't handle web tests yet. I'll do those in follow-up
patches.

Change-Id: Id06397a20a06c00e48801a16c01d5878e0264f6b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146462
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
2020-05-13 01:06:14 +00:00
Robert Nystrom 2bf3259005 Migrate language_2/generic to NNBD.
Change-Id: I582fa00eb713282c3bd6fc1607efc0242ce9076f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146686
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2020-05-13 01:00:35 +00:00
Joshua Litt 304bcf8685 [dart2js] Fix cfe_constant_evaluation_test for nnbd.
Change-Id: I36d63b205ae9f18a6ed8055020b03214b34b2387
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145242
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2020-05-12 23:43:09 +00:00
Paul Berry 275b922ee8 Revert recent parser fixes
Commit 1f9b5c1996 causes tests to fail
in angular when rolled into internal sources; the other two commits
need to be reverted as well to avoid merge conflicts.

This reverts commit 1f9b5c1996.
This reverts commit c40b24da48.
This reverts commit 96df1f9e6c.

Change-Id: Ic4e55181ef60e825ce4409a9a9528ecbf19c39c4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/147822
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-05-12 22:02:09 +00:00
Joshua Litt b714d1c356 [dart2js] Remove obsolete unittests.
Bug: https://github.com/dart-lang/sdk/issues/33072

Change-Id: I0f6d5d2595fdb5ceecdbec68acdab987829be770
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/147780
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-05-12 17:16:39 +00:00
Srujan Gaddam 0afd7a6907 [dart:html] Unsuppress MediaDevices.getUserMedia
Bug: https://github.com/dart-lang/sdk/issues/35253

This API was suppressed initially due to issues with conversions
between promises and futures. Now that that has been resolved, this
should be unsuppressed. Tests have been refactored to use both
navigator.getUserMedia and navigator.mediaDevices.getUserMedia.

Change-Id: Ia131b303192c7eaa3f08475cf700a53665ab3584
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/147640
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2020-05-12 16:59:49 +00:00
Erik Ernst 4fc60b20df New test, based on language PR #940 about ==.
Change-Id: Iddb347f05eac14048969eb4e6b05e9eab31532e6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145582
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2020-05-12 16:31:59 +00:00
sgrekhov 5dc4e9362a [co19] Re-enable tests skipped due to breaking change #40674
The co19 tests were fixed in the co19 and co19_2 suites.

Change-Id: Ib71bfdcb90b0f4b77c77f3fc6ee74f47605b71af
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145580
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2020-05-12 14:51:19 +00:00
Zichang Guo 9a60982089 [dart:io] serialize UnmodifiableListView to Uint8List for file write
Bug: https://github.com/dart-lang/sdk/issues/41029
Change-Id: I5902f01a22787922439f0918b6e845eb004b8984
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/139881
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Zichang Guo <zichangguo@google.com>
2020-05-12 00:19:01 +00:00
Martin Kustermann 57e54cdd31 [vm/isolate] Prefer .dart_tool/package_config.json over .packages
Flutter has migrated away from using the discontinued
`package:package_resolver`, see [0], which should allow us to prefer the new
`.dart_tool/package_config.json` format now.

[0] https://github.com/flutter/flutter/issues/56289

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

Change-Id: I9026af05756d01f4a3e0e0fc97fa77d27bf805b4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146840
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2020-05-11 17:32:07 +00:00
Stephen Adams 341034f4e3 [dart2js] Update codegen/logical_expression_test
Test still fails - see issue 17027.

Change-Id: I6cb2c9dd4197d45efcb13afa608912e5374f9b5c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/147300
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2020-05-11 17:04:47 +00:00
Jens Johansen 96df1f9e6c [parser] Add ErrorToken for ignored (unmatched) end parenthesis, brackets etc
Change-Id: Idb57295700988d71321743af9782134b02562311
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146240
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-05-11 14:46:47 +00:00
Stephen Adams 1924d64351 [corelib] Fix for BigInt.toDouble() crash
Bug: 41819
Change-Id: Ied24b42728e1da0d713fe971386d4ef6a023333e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/147349
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2020-05-09 00:22:16 +00:00
Joshua Litt 5e5105d7b1 [dart2js] Re-enable an inference_test.
Change-Id: I9136c129f80ee80cfdc2594ba0922881ac324570
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/147323
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2020-05-08 12:42:59 +00:00
Joshua Litt 022a6a2da5 [dart2js] Delete generate_code_with_compile_time_errors_test.
Change-Id: If719a421785a298331cb1fd9fbb6dcf1d3d2841c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/147240
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2020-05-08 12:23:49 +00:00
Joshua Litt 617bc54b71 [dart2js] unit test patch for unfork cl.
To be submitted with the unfork cl.

Change-Id: Ie045499a98cf4ca69002fbdfe1391f358f96f534
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145642
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-05-07 23:23:09 +00:00
Stephen Adams 9491c6cc48 [dart2js] Fix codegen/variance_subtype_cast_test
- We don't need to use the type to check for the presence and absence
  of a check, '._as(' is sufficient.
- Added ability of Absent/Present checker to use regexps

Change-Id: Ie1ecaafcaa3d5121b19ffd77564d800e0c72bd4f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/147020
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2020-05-07 16:38:28 +00:00
Erik Ernst 2cc46eab0b Adjust tests for new return rules, cf. language PR #941, #948.
The rules for returns with null-safety were changed in language PR #941,
and this PR makes changes to async/return_types_test.dart such that it
matches the new rules. Check base vs. patchset 1 to see these adjustments.

The main part of this PR is that it migrates and updates the tests
language/invalid_returns/{,a}sync_{,in}valid*_test.dart such
that they match the new rules. Check patchset 1 vs newest patchset
to see this migration.

Note that some tests are new, e.g., 'sync_invalid_return_27_test',
which was added because it is a new property that there is an error
for "return void to Null". Also note that some of the tests are
redundant: (1) It is no longer allowed to return void to Null, but
(2) that's an error already with null-safety, because it's a
downcast (so it doesn't matter which supertype of `Null` we have).
I kept these tests anyway (and even wrote this new one), because
they do check that certain changes have been implemented, even
though it is in some cases redundant in the sense that it's just
another verification that implicit downcasts aren't supported any
more. If we don't want this redundancy then we should remove about
10 tests (sync_invalid_return, async_invalid_return).

Change-Id: I3f10682e1d0ed75067d6e8651588b727ffd3648f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145587
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2020-05-07 16:00:48 +00:00
Lasse Reichstein Holst Nielsen 58c86e254b Migrate tests to language/stack_trace.
Change-Id: I4f6ac937327a7e610976668377b9cccb03d89d9c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146583
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2020-05-07 13:47:57 +00:00
Stephen Adams 733153eb51 [dart2js] Remove obsolete test
This test is outdated by at least two versions of how we represent
function types.

Change-Id: I4feaea79cae4711d62b9f47bda987e67cbf1dad8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/147002
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
Auto-Submit: Stephen Adams <sra@google.com>
2020-05-07 01:39:22 +00:00
Alexander Markov 32d4ac903b [vm/aot/tfa] Fix crash while getting static type context for signature shaking
Fixes https://github.com/flutter/flutter/issues/56479

Change-Id: I3e308382bf64b1b1aa39174c2095ee7a465907a4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146980
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2020-05-07 00:56:02 +00:00
Stephen Adams d8ec34e830 Fix dart2js/codegen/list_tracer_length_test
Fix test by restricting checked text to a function.
Adjusted one input to account for analysis improvements.


Bug: 33051
Change-Id: Ie2235b5e7149b136c24163cfae9c762dd668ab3c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146988
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2020-05-07 00:41:22 +00:00
Stephen Adams caee2f8e91 Remove obsolete failing gvn_dynamic_field_get_test.dart
Change-Id: I58be5c299bb42d03d2a3b3973ac319d8895aa9e6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146983
Auto-Submit: Stephen Adams <sra@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2020-05-06 23:36:12 +00:00
Konstantin Shcheglov 89fa166cdb Issue 41778. Update language/extension_methods/static_extension_getter_setter_conflicts_test
Bug: https://github.com/dart-lang/sdk/issues/41778
Change-Id: Ifafabebaf5b3a8c36e3d9d9b79ef5221100a67bf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146963
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-05-06 22:50:32 +00:00
Joshua Litt f12666eb69 [dart2js] Trivial nnbd fix for strong_mode_impact_test.
Change-Id: Iafff92a75d7a9a695e2884c2a247145fc590ce5f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145303
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2020-05-06 21:51:32 +00:00
Stephen Adams 4ecc42b999 fix dart2js/codegen/side_effect_tdiv_regression_test.dart
Change-Id: Ida556bfcb080752e19025e5b59564b33cb4d2223
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146961
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2020-05-06 20:35:53 +00:00
Joshua Litt 56692fefca [dart2js] Rebase rti expectations for nnbd.
Change-Id: Ibc3cfa5748fd49fae003eacdcc41ca13e8c6094d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146443
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2020-05-06 19:36:02 +00:00
Stephen Adams a85c8b7520 [dart2js] Handle BlockExpression with unreachable value
Bug: 41781

Change-Id: I2647bfededaa8449b1ccec6529b07a274d35cac8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146694
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2020-05-06 19:22:15 +00:00
Konstantin Shcheglov d0b9c1c1ac Update mirrors/syntax_error_test.dart for NNBD.
Change-Id: I7ca38af9d7651c9d11e50a54049416df9e00d44a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146699
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-05-06 16:40:52 +00:00
Johnni Winther a2015351c8 [dart2js,ddc] Ensure valid d8 breakpoints in testing
D8 breakpoints used in sourcemap testing should only be set for
test files and not, accidentally, in sdk source files. This
was hit in a dart2js step debugging test where, after unforking,
the line number in the test file accidentally matched those of
print.dart from the sdk.

Change-Id: I6a9c6f5bfd28b8821e9cee9b10cc6c67e4fc689b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146781
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-05-06 14:36:32 +00:00
Ben Konyi acf7b4bc1d Update comments in snapshot_fail_test
Change-Id: I3ff794dcf88d96931cec75b6b8b8ce8742eed3e3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146693
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2020-05-05 23:44:12 +00:00
Konstantin Shcheglov 20917915bb Update corelib/list_test for default exception type change.
R=brianwilkerson@google.com

Change-Id: I2bb89d5c422872ba5008c6375b8f27b02b9a95c5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146683
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-05-05 22:25:27 +00:00
Zichang Guo 4549484390 [dart:io] tests http parsing decoding latin1
Closes https://github.com/dart-lang/sdk/issues/41706

Change-Id: Icde8046b40bb3f77b015a61478b8ef6f94f5870c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145500
Commit-Queue: Zichang Guo <zichangguo@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
2020-05-05 20:32:03 +00:00
Ben Konyi 918eae3e5e Reland "[ dartdev / DDS ] Spawn a Dart Development Service instance when running with --observe via dartdev"
This reverts commit 798b6e7c8d.

Change-Id: I5af5eb126d83d8f67b18d5159ead0a276665034e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146661
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-05-05 18:48:58 +00:00
Robert Nystrom b955271e51 Migrate language_2/function_subtype to NNBD.
Change-Id: I8d41ad649c83cd97253006693a0cf3676de418e9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145542
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
2020-05-05 16:52:30 +00:00
Lasse Reichstein Holst Nielsen 7bb38670d2 Don't run tests depending on member names when obfuscated.
Bug: http://dartbug.com/41771
Change-Id: I1f4a7d4900e225ca05bb445db0e22e85a71f8723
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146582
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2020-05-05 12:46:54 +00:00
Lasse Reichstein Holst Nielsen 765c9c3a8e Make tests not assume catch(e) gives e type dynamic.
See #41558

Bug: http://dartbug.com/41558
Change-Id: I8980ad6e0d240c917f36ec4f9fcf2091fb61a4b7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/143819
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2020-05-05 09:57:23 +00:00
Lasse Reichstein Holst Nielsen 2ca3555c44 Allow NoSuchMethodError.withInvocation to accept any Invocation.
Currently the VM only accepts an `_InvocationMirror` instance, not a user created `Invocation`.

Fixes #33124

Bug: http://dartbug.com/33124
Change-Id: Ifdc95861cbe632bc317ca8d9fb92cf0d3ae600f0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140100
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2020-05-05 08:10:13 +00:00
Robert Nystrom 6cddb9eb1b Migrate language_2/function_type to NNBD.
Change-Id: I4599b9a2bc0a410b977cd95ee75b62557eca8aae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145567
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
2020-05-05 01:38:43 +00:00
Joshua Litt fb5ebf6a09 [dart2js] Fix and rebase impact test for nnbd.
Change-Id: I545f5df00c4e8c1ae6a60ec6a6c4458c5d53db78
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146360
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2020-05-04 22:05:37 +00:00
Mark Zhou 3391be2d16 [tests] Adding and extending tests for required named parameters.
Some of these are currently disabled in the CFE. See: https://github.com/dart-lang/sdk/blob/master/pkg/front_end/lib/src/fasta/source/source_library_builder.dart#L403

Change-Id: If5aeff4e3743ea589e8c2572ada869aeced5c826
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144671
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
2020-05-04 21:17:47 +00:00
Martin Kustermann a94b8ae45d Reland "[vm] Make VM support .dart_tool/package_config.json"
This relands the following CLs

    [vm] Make VM support .dart_tool/package_config.json
    https://dart-review.googlesource.com/c/sdk/+/145462

    [vm] Make Isolate.resolveUri() work for both `.packages` and `dart_tool/package_config.json`
    https://dart-review.googlesource.com/c/sdk/+/145803

    [vm] Skip (newly enabled) isolate tests on simarm* and hot-reload configs
    https://dart-review.googlesource.com/c/sdk/+/145861

    [vm] Remove ../0 postfix from status file entries (test framework does not recognize those multitests)
    https://dart-review.googlesource.com/c/sdk/+/145940

    [vm] - Fix hang when no package config or .packages exist
    https://dart-review.googlesource.com/c/sdk/+/145661

The only change (extra patchset) is to let VM prefer the old/legacy
".packages" format and only use the newer
".dart_tool/package_config.json" if we failed to find a ".packages".

Closes https://github.com/dart-lang/sdk/issues/41739
Closes https://github.com/dart-lang/sdk/issues/41649

Change-Id: I220f808540e6e521d985ae763968f64dbf57fe67
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145942
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2020-05-04 14:51:14 +00:00
Johnni Winther e7bebea059 [analyzer,cfe,dart2js] Make id-testing wildcard customizable and unsupported by default
Change-Id: Id11dc3c04d1d42853566e492b7d5aead4a35a724
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145781
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-05-04 12:58:24 +00:00
Aske Simon Christensen f5bf50e7a4 Adjust UTF-8 tests to match WHATWG standard expectations.
This adjusts all UTF-8 tests to the new semantics in the breaking
change described here: https://github.com/dart-lang/sdk/issues/41100

This has three parts:
- Unpaired surrogates are encoded as replacement characters, and
  encoded surrogates are considered malformed input when decoding.
- Decoding errors are generally reported on the position of the byte
  that conclusively makes the input malformed.
- The number of replacement characters emitted by the decoder is
  generally one per unfinished sequence or undecodable byte.

The code changes to implement the new semantics are placed in subsequent
commits.

Change-Id: I4cc8ce660e39287e734070764ab8e1f0ebb8b9e0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/143815
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2020-05-04 10:48:32 +00:00
Johnni Winther 645f3acca7 [cfe] Update greatest closure of ? to Object?
Closes #41386

Change-Id: I1a5a4cdc35cef37c7a8ba6a6aecb99457789bcdc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144940
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2020-05-04 08:14:43 +00:00
Sam Rawlins 018dab4568 Analyzer: Report a constructor which redirects to a constructor of an abstract class
Fixes https://github.com/dart-lang/sdk/issues/37552 and
fixes https://github.com/dart-lang/sdk/issues/34370

Change-Id: I75e68157cf7e6e9824353c307a8e9f6669f8ea82
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145571
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2020-05-02 03:53:55 +00:00
asiva 170d047b20 The rolls of Dart into Flutter have been failing for more than a day now.
We have accumulated almost 69 commits. Please see issue
https://github.com/dart-lang/sdk/issues/41739
for details of why these CLs had to be reverted.

Revert "Reland "[vm] Make VM support .dart_tool/package_config.json""
This reverts commit fa6cc57a32.

Revert "[VM] - Fix hang when no package config or .packages exist"
This reverts commit 31be795457.

Revert "[vm/isolate] Make Isolate.resolveUri() work for both `.packages` and `dart_tool/package_config.json`"
This reverts commit a99f7aef6e.

Revert "[vm] Skip (newly enabled) isolate tests on simarm* and hot-reload configs"
This reverts commit 7082e99c28.

Revert "[vm] Remove ../0 postfix from status file entries (test framework does not recognize those multitests)"
This reverts commit 708468684a.

Change-Id: Id6b951bde4f379fdcfac3cc23e0057a77a7e6db0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146041
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2020-05-01 22:11:55 +00:00
Joshua Litt 364a2ac7d5 [dart2js] Fix cfe_annotations_test nnbd.
Change-Id: I00c32a74bd8995fe40b88f75c2a1431e04f927d7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144993
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-05-01 20:07:44 +00:00
Martin Kustermann 708468684a [vm] Remove ../0 postfix from status file entries (test framework does not recognize those multitests)
Change-Id: Ice38515bf74f75b2cc4d76cd7de1c953d8e8d355
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145940
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-05-01 17:11:29 +00:00
Riley Porter 3c6a431589 Change types to <C?, D> in cast test for nnbd
Change-Id: Id61ac90e028d8cb05ab0aba52ecd772644b4f773
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145721
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Riley Porter <rileyporter@google.com>
2020-05-01 17:02:23 +00:00
Martin Kustermann 7082e99c28 [vm] Skip (newly enabled) isolate tests on simarm* and hot-reload configs
The test runner doesn't support Isolate.spawnUri for simarm*.
The --enable-isolate-groups is not supported in JIT + hotreload yet.

Change-Id: Ibea7de252b37e18130340d2156369d761728af56
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145861
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-05-01 14:51:27 +00:00
Martin Kustermann a99f7aef6e [vm/isolate] Make Isolate.resolveUri() work for both .packages and dart_tool/package_config.json
Change-Id: I0f923e65f6bb00def2f96704bc51aa751d55ce7e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145803
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2020-05-01 14:13:01 +00:00
asiva c740bbc161 [VM] Set up Isolate specific null safety mode
- change the null_safety flag to be a tri state flag (unspecified, no
  null safety and null safety)
- added logic to set the null safety mode of an isolate based on the
  value specified in the kernel file (.dill file) if the null safety
  flag is not specified on the command line
- added logic to auto detect the null safety mode based on the language
  version API provided by CFE
- added logic to pass the correct null safety option to CFE when
  invoking it for compilation based on the null-safety flag setting
- Delete non-nullable-flag() function and adjust code that was using it.
- Remove 'nnbd-experiment' from the snapshot string.

https://github.com/dart-lang/sdk/issues/41206
https://github.com/dart-lang/sdk/issues/41207

Change-Id: I006bf3c9229980fc7986faac6a5850d3722aec92
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/143160
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Liam Appelbe <liama@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-05-01 04:03:04 +00:00
asiva 31be795457 [VM] - Fix hang when no package config or .packages exist
When package config or .packages file is missing and a test is
run the VM goes into an infinite loop in _findPackagesConfiguration

Change-Id: Ic920a401cbbac73bcffcac68ab358fb6246ff8c6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145661
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2020-04-30 22:03:02 +00:00
Nate Bosch 420f50a392 Remove tests for addresses with leading 0s
Closes #41727

These are invalid on linux, but treated as valid on mac.

Change-Id: I0ccee97048b163f419ad88f8cfcd3d5cde427ea9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145641
Commit-Queue: Nate Bosch <nbosch@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Auto-Submit: Nate Bosch <nbosch@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2020-04-30 19:30:02 +00:00
Nate Bosch 9b34bee90b Add InternetAddress.tryParse
Closes #40692

Allows a better pattern for parsing user input than catching an
`ArgumentError`.

- Add a new static method to InternetAddress and implement it in all
  patch files.
- Add tests which match the tests for the constructor.

Change-Id: Idc76fc4875578f7a381219c0e7e12d1931d98fd8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136406
Commit-Queue: Nate Bosch <nbosch@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Auto-Submit: Nate Bosch <nbosch@google.com>
2020-04-30 17:19:02 +00:00
Mark Zhou b4582d25d9 [dart2js] Adding support for required named parameters.
Supercedes previous work here: https://dart-review.googlesource.com/c/sdk/+/128849

Change overview:

* In legacy mode, the isRequired flag for parameters in the kernel IR is treated as false (though this bool is still processed during serialization).

* Adds a Set<String> to the element model to represent required-ness. All named parameters are still stored in a single "bag".

* ParameterStructure objects additionally emit/ingest all required named parameters as well during serialization.

* A bool indicating whether or not a parameter is required is emitted after each named parameter when serializing FunctionTypes.

* JS identifiers for functions with required named parameters now emit '$req' before each required named parameter. E.g., dynamic_Function_String_$named_p0_int_$req_p1_int for dynamic Function({int p0, required int p1}).

* Recipes now indicate required named parameters with '!' instead of ':'. E.g., @(int,{p0:int,p1!int}) if p1 is required and p0 is optional.

* A requiredNamedSeparator was added to the shared recipes to accommodate the above.

* The RTI now represents named function parameters as a repeating list of triplets (name/bool/type). This adds a bit of overhead to our parser but makes subtype checks simpler.

* Does NOT include changes to Function.apply + auxiliary information attached to closures. These will be added in a later patch.

Fixes #39730
Change-Id: I9c9eaac28da0d63bb16bdb439f021f1470539563
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/141204
Commit-Queue: Mark Zhou <markzipan@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2020-04-30 16:53:32 +00:00
Konstantin Shcheglov cf3a034210 Implement promotion via initialization in flow analysis.
Change-Id: I10a5f6bfeb5a05dd144db5212c9f31796f5a2385
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145502
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-04-30 16:26:27 +00:00
Johnni Winther a9b81e18d9 [cfe] Handle dynamic return in async
Closes #41437

Change-Id: I493b516f0b72fc1da097b92bd75150aea8e60ba7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145042
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-04-30 12:39:04 +00:00
Johnni Winther e046afac1f [cfe] Don't print nullability on Null in messages
Change-Id: I530d3eef1a0af73d68aaccf33095ab2dcaf4747c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145461
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-04-30 08:16:24 +00:00
sgrekhov 9b9f89a64c [co19] Skip not migrated to NNBD folders in a status file
Change-Id: Iaf54ad33ae79291caffda74843d46a238b6c2a17
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144945
Reviewed-by: Sergey Grekhov <sgrekhov@unipro.ru>
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Sergey Grekhov <sgrekhov@unipro.ru>
2020-04-30 05:29:14 +00:00
Riley Porter 654b725ee4 [tests] Fix cast_test and migrate to nnbd.
Also splits up cast_test to test collections separately and
updates corelib_2 version with the same changes, including
fixes in relevant pending CL:
https://dart-review.googlesource.com/c/sdk/+/126320

Fixes #39517

Bug: http://dartbug.com/39517
Change-Id: I8df1fde1d48ed23561ce9d0d8b87d7fc2ba52eb1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144469
Commit-Queue: Riley Porter <rileyporter@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2020-04-30 02:33:53 +00:00
Stephen Adams ef1528aa78 [js_runtime] Never is a bottom in legacy mode
Opt-in code can have Never types even with legacy subtyping.

Bug: 41675

Change-Id: I6dbdc064dceeedf0774d10faaca336561b41b7d5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145561
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2020-04-30 01:41:02 +00:00
Alexander Markov d2ae466056 [vm/aot] Update references from types to mixin applications after deduplication
CFE may use anonymous mixin application classes in types after
applying LUB (Least Upper Bound) algorithm in conditional expressions,
and then those types can spread via type inference.

After anonymous mixin application classes are deduplicated, all
references to removed mixin applications from types should be
updated to point to the remaining mixin application.

Fixes https://github.com/flutter/flutter/issues/55345

Change-Id: I7860b2868cb153d125fec363c1653b7aa16521e6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145501
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-04-29 23:54:08 +00:00
Robert Nystrom 62d5f57477 Migrate language_2/extension_methods to NNBD.
Change-Id: Ic4426baeb9d02624af5f60106473a1eeced15310
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142780
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2020-04-29 21:36:28 +00:00
Martin Kustermann fa6cc57a32 Reland "[vm] Make VM support .dart_tool/package_config.json"
This CL makes the VM add support for .dart_tool/package_config.json via
  * the --packages=<file> command line parameter
  * the `packageConfig: <file>` parameter to `Isolate.spawnUri`

It also allows now `package:*` uris being used in `Isolate.spawnUri`

The CL also removes the unused `packageRoot` parameter from the Dart to
C++ interface as well as in various places in C++.

The CL also aligns the implementations between sdk and sdk_nnbd more.

Issue https://github.com/dart-lang/sdk/issues/41649
Issue https://github.com/dart-lang/sdk/issues/41245
Issue https://github.com/dart-lang/sdk/issues/41246

Change-Id: I0a7aa3040332abafa19bf80bdbd8a8f8594cc6fe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145462
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2020-04-29 19:05:26 +00:00
Joshua Litt e580dd8e84 [dart2js] Remove hardcoded paths in dart2js unit tests.
Change-Id: Ic223c44d917ca55f07f9f62752a91ef4db325444
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145180
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-04-29 18:24:24 +00:00
Joshua Litt 0b1451c5fd [dart2js] Trivial nnbd fix for no_such_method_forwarders_test.
Change-Id: Ib55e3c632c99e0700d239fe0c62e35aeadb0bf0e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145301
Reviewed-by: Mayank Patke <fishythefish@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2020-04-29 14:21:03 +00:00
Nicholas Shahan 207953f367 [tests] Add regression tests for internal issue
We already landed a workaround for b/154963234 as
https://dart-review.googlesource.com/c/sdk/+/144815. Adding
these tests to ensure the followup fix doesn't break it again.

Change-Id: Ic021c2b3f0e5b3cd12ae0286ac5146c71f380aa2
Bug: b/154963234
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144988
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2020-04-28 23:49:43 +00:00
Paul Berry 885de405d2 Add test to validate resolution of #39641.
This test validates my understanding of
https://github.com/dart-lang/sdk/issues/39641#issuecomment-573669413,
namely that when assigning to a promoted variable, the context used to
do inference of the RHS of the assignment should come from the
promoted type, but it should still be ok if the RHS doesn't evaluate
to a subtype of the context type (in which case the assignment
de-promotes).

Change-Id: Iafb2e741f8b9631a9b017804a5ad59972bfc638e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144883
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-04-28 23:28:13 +00:00
Alexander Aprelev 334284a69b Revert "Reland "[vm] Make VM support .dart_tool/package_config.json""
This reverts commit 30085612f4 as it
broke vm-kernel-precomp-nnbd-linux-release-x64 bot.

Seems to be the same failure as the last time it was reverted: https://ci.chromium.org/p/dart/builders/ci.sandbox/vm-kernel-precomp-nnbd-linux-release-x64/537

Change-Id: I35a1897367bcb65f518b58659001280c5d5ed930
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145262
Reviewed-by: Alexander Aprelev <aam@google.com>
2020-04-28 23:23:44 +00:00
Nicholas Shahan 3da1591253 [ddc] Fix function type casts in weak mode
Allow null to be cast as function types in weak mode.

Change-Id: I42084250c428b7e6a18ce343305d43603b4e1ec4
Fixes: https://github.com/dart-lang/sdk/issues/41680
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144995
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
2020-04-28 21:19:54 +00:00
Joshua Litt ed6da1c899 [dart2js] NNBD changes for future_or_test.
Change-Id: I8911179c33f99fb604f0bee309140c85711ff536
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/143880
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2020-04-28 19:01:22 +00:00
Martin Kustermann 30085612f4 Reland "[vm] Make VM support .dart_tool/package_config.json"
This CL makes the VM add support for .dart_tool/package_config.json via
  * the --packages=<file> command line parameter
  * the `packageConfig: <file>` parameter to `Isolate.spawnUri`

It also allows now `package:*` uris being used in `Isolate.spawnUri`

The CL also removes the unused `packageRoot` parameter from the Dart to
C++ interface as well as in various places in C++.

The CL also aligns the implementations between sdk and sdk_nnbd more.

Issue https://github.com/dart-lang/sdk/issues/41649
Issue https://github.com/dart-lang/sdk/issues/41245
Issue https://github.com/dart-lang/sdk/issues/41246

Change-Id: Idec0990c731f34efda9c39672067eae9174319f1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144826
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2020-04-28 16:52:02 +00:00
Mayank Patke 7ac53f1825 [dart2js] Treat Object as a top type in weak mode.
We were only treating Object as a top type if NNBD was disabled. This is
incorrect and we should be treating Object as a top type whenever legacy
subtyping is in effect. In particular, Object acts as a top type in weak
mode.

Change-Id: I76acc25e92fda2b9e2b7872fc72d319161318874
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144689
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2020-04-28 02:27:26 +00:00
Konstantin Shcheglov 3e26a5d0dd Issue 40957. Report the language feature, and recommend to set SDK constraint.
...but don't recommend to enabled any experiment.

R=brianwilkerson@google.com, paulberry@google.com

Bug: https://github.com/dart-lang/sdk/issues/40957
Change-Id: I556ce9952b28d0b079521ac46558f8e3adf352c5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144982
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-04-27 22:11:46 +00:00
Ryan Macnak 3cb7eaa4cb Revert "[vm] Fix test to use Uri.file() instead of Uri.parse()"
This reverts commit 87ce4a504f.

Revert "[vm] Make VM support .dart_tool/package_config.json"

This reverts commit b112aa0d8b.

Reason for revert: Failures on Windows

Change-Id: I3e4f601d7638b25df313773e525c9284737fa729
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144985
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2020-04-27 21:55:46 +00:00
Robert Nystrom d9bb487ca8 Treat the expect and async_helper packages as opted in to NNBD.
This should enable strong mode tests to be fully NNBD opted in. At the
same time, legacy tests when run with the experiment off should
hopefully be able to still consume these libraries because they don't
actually use any NNBD features.

To do this, I changed the script that generates the SDK repo's package
config to not put in a language version for any package whose pubspec
has no SDK version. According to language versioning, that means the
package should be considered to be at the "current" version of the SDK
running the code.

In NNBD, that's opted in. With the experiment off, that is (presumably)
"opted out" in the sense that NNBD doesn't exist.

In order to *not* opt in some of the other packages that currently
lack SDK constraints, I put those in and pinned them to "^2.7.0" which
was what the package config script used to implicitly fill in for them.

I see a bunch of other changes in the generated package config too. The
update script probably hasn't been run in a while.

Change-Id: I55193d42eac0696a6b0105546551efa45a1f3252
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144305
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
2020-04-27 21:04:56 +00:00
Konstantin Shcheglov eada4d8d65 Implement Factor in flow analysis.
Bug: https://github.com/dart-lang/sdk/issues/40014
Change-Id: I8d21d3c3368495d9d0dbb1cd52317b053657a176
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144804
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2020-04-27 18:47:08 +00:00
Joshua Litt 02142fe49e [dart2js] Fix two type inference bugs with legacy subtyping.
Change-Id: Ie4ecd82f64b0ebebf65f7e2787881942762862dd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144662
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2020-04-27 18:42:38 +00:00
William Hesse 811cb746d3 [tests] Fix CompileTime error in implement_rectangle test.
Fixes: https://github.com/dart-lang/sdk/issues/41541
Change-Id: I46f069145990f548848e6efef9e8d4c9c939adf2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144942
Reviewed-by: Liam Appelbe <liama@google.com>
Reviewed-by: Riley Porter <rileyporter@google.com>
2020-04-27 17:21:26 +00:00
Martin Kustermann 87ce4a504f [vm] Fix test to use Uri.file() instead of Uri.parse()
This is a follow-up to

  https://dart-review.googlesource.com/c/sdk/+/144766

Change-Id: Ibff4b307b0293b34a5afdf3d8c508cb8ee66c663
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144944
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
Auto-Submit: Martin Kustermann <kustermann@google.com>
2020-04-27 15:28:38 +00:00
Martin Kustermann b112aa0d8b [vm] Make VM support .dart_tool/package_config.json
This CL makes the VM add support for .dart_tool/package_config.json via
  * the --packages=<file> command line parameter
  * the `packageConfig: <file>` parameter to `Isolate.spawnUri`

It also allows now `package:*` uris being used in `Isolate.spawnUri`

The CL also removes the unused `packageRoot` parameter from the Dart to
C++ interface as well as in various places in C++.

The CL also aligns the implementations between sdk and sdk_nnbd more.

Issue https://github.com/dart-lang/sdk/issues/41649
Issue https://github.com/dart-lang/sdk/issues/41245
Issue https://github.com/dart-lang/sdk/issues/41246

Change-Id: I642dfb89f82b3f2c1613e443850bf0b4fb91f4a1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144766
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2020-04-27 12:54:38 +00:00
Robert Nystrom 5ed88471ec Migrate language_2/function to NNBD.
Change-Id: I0726fa252736a83a2d80345d71c05aacf8ed0649
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142941
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2020-04-25 01:53:20 +00:00
Leaf Petersen 6fd7c57f4e Fix incorrect assert in null safe Future.wait and add regression test.
Closes https://github.com/dart-lang/sdk/issues/41656 .

Change-Id: I4472f34a4011e18f9f5d4db4f7a3dfd3eb6a8366
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144809
Auto-Submit: Leaf Petersen <leafp@google.com>
Commit-Queue: Leaf Petersen <leafp@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2020-04-25 00:00:37 +00:00
Konstantin Shcheglov 46a2086e6c Issue 41479. When terminate null shorting at CascadeExpression, don't make it nullable.
Bug: https://github.com/dart-lang/sdk/issues/41479
Change-Id: I2d843846ca2a0232dbea60ad2b71e745ac118588
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144672
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2020-04-24 18:45:13 +00:00
Joshua Litt 32c3a2cde7 [dart2js] Rebase nnbd expectations for 3 tests.
cfe_constant_test
inlining_test
jfield_analysis

Change-Id: Ib2833507f4e19f3d6a1e5055977bccc962b2d791
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144494
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-04-24 18:30:03 +00:00
Joshua Litt 8495451a6b [dart2js] fix id testing labels.
Change-Id: I4d40cf9f0b99fa8534d3c6b98deaa4a9a1616231
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144620
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-04-24 15:30:13 +00:00
Leaf Petersen 6befc18cae Add tests for assignability around Never.
Change-Id: I2d3548eb609743277c026155d70fc1cb4d976cc7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/143040
Reviewed-by: Erik Ernst <eernst@google.com>
2020-04-24 04:38:43 +00:00
Konstantin Shcheglov 8990c063b7 Issue 41603. await voidExpression is an error.
Bug: https://github.com/dart-lang/sdk/issues/41603
Change-Id: I6cbd8938c62e7f5f60e48e0ee65b80f4924a3a65
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144681
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-04-24 03:42:52 +00:00
Nicholas Shahan 1accf661e2 [tests] Break test into weak and strong versions
In weak mode A<dynamic> is a subtype of A<Object>. Break out this
expectation into separate files for weak and strong modes.

Change-Id: I8d7b10d836eeb4a3221fe51ee7717aa544347b05
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144682
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2020-04-24 01:03:52 +00:00
Nicholas Shahan ea03ea355c [tests] Loosen weak expectation to any throw
The current behavior is inconsistent across the backends so locking this
down in weak mode feels like a subtle breaking change. The VM currently
tries calling .iterable and throws a NoSuchMethodError. DDC throws a
TypeError.

Change-Id: Ib121a91f045a4f190be77dc57b5c216d818e0301
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144683
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2020-04-23 21:54:10 +00:00
Joshua Litt 6f5f7ad05c [dart2js] rebase deferred_loading_test for nnbd.
Change-Id: Ia8cd18e19554afec57675bab64797984445556c5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/143820
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-04-23 01:17:58 +00:00
Zichang Guo 913cf2583e Revert "[dart:io] Fixes Ping/Pong mechanism not updating readyState when closing"
This reverts commit ac5b24123d.

Reason for revert: Tests are hanging on Windows. https://logs.chromium.org/logs/dart/buildbucket/cr-buildbucket.appspot.com/8882288664919412608/+/steps/test_results/0/logs/new_test_failures__logs_/0

Original change's description:
> [dart:io] Fixes Ping/Pong mechanism not updating readyState when closing
> 
> Bug: https://github.com/dart-lang/sdk/issues/33362
> Change-Id: Icf21ad5c9b66c4176ec65e018f9499b24690ed2c
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/143890
> Commit-Queue: Zichang Guo <zichangguo@google.com>
> Reviewed-by: Jonas Termansen <sortie@google.com>

TBR=sortie@google.com,asiva@google.com,zichangguo@google.com

Change-Id: I6f32f4a5bf29d949f26381394ce16e103e715c65
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/dart-lang/sdk/issues/33362
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144490
Reviewed-by: Zichang Guo <zichangguo@google.com>
Commit-Queue: Zichang Guo <zichangguo@google.com>
2020-04-22 21:28:11 +00:00
Zichang Guo ac5b24123d [dart:io] Fixes Ping/Pong mechanism not updating readyState when closing
Bug: https://github.com/dart-lang/sdk/issues/33362
Change-Id: Icf21ad5c9b66c4176ec65e018f9499b24690ed2c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/143890
Commit-Queue: Zichang Guo <zichangguo@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
2020-04-22 20:12:59 +00:00
Joshua Litt 7f795b9f18 [dart2js] Rebase api_dynamic_test for nnbd.
Change-Id: I67106666574b0e11280ca8bc582665692c547208
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144342
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-04-22 19:47:59 +00:00
Nicholas Shahan 23cbe39355 [ddc] Remove error handler from number parse helpers
This copies the logic from dart2js and brings the two patches closer
together. There is no need to pass the error handler to the helper
function shared between `parse()` and `tryParse()`.

Update JS foreign function types in parseDouble to match the NNBD
version.

Fixes: https://github.com/dart-lang/sdk/issues/41613

Change-Id: I85d39f8ba6bd76459cf6263099983b8b96d3a669
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144304
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2020-04-22 16:07:29 +00:00
Stephen Adams e6baa97e9a [dart2js] Fix bug with unused generator type parameters
Ensure that a generator entry point only passes type arguments for
parameters that are not erased.

The generator header was passing too many arguments to the generator
body, causing the element type to be misaligned.

Change-Id: I062df5f7172ed8bb410c81013a3faee35d66ef1b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144351
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2020-04-22 04:58:44 +00:00
Siva Annamalai af4330d382 Revert "[tests] rewrite and format several tests on http"
This reverts commit e35120cfd1.

Reason for revert: This CL caused some breakages in the bot.

Original change's description:
> [tests] rewrite and format several tests on http
> 
> Resolve comments in previous cls.
> https://dart-review.googlesource.com/c/sdk/+/140564
> https://dart-review.googlesource.com/c/sdk/+/136322
> https://dart-review.googlesource.com/c/sdk/+/138860
> 
> Change-Id: I9549019fe871f35187af5ff75df320748792498b
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/141845
> Commit-Queue: Zichang Guo <zichangguo@google.com>
> Reviewed-by: Jonas Termansen <sortie@google.com>

TBR=sortie@google.com,rmacnak@google.com,zichangguo@google.com

Change-Id: I1ae183dcc4b202b7b1e21d30a1407f9b038791ba
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144306
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2020-04-22 03:27:36 +00:00
Liam Appelbe 87b829bacd [nnbd] Fix some more strong mode tests
All these tests now pass in both weak and strong mode, except for
relation_subclass_test and typedef_reflected_type_test. For those 2
tests I fixed the compile time error and now they have the same runtime
errors in both weak and strong mode (they were already failing at
runtime in weak mode).

Change-Id: If0157f811fffcf72a12ce6690ac0568c8f4419a9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144343
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2020-04-22 00:12:24 +00:00
Zichang Guo e35120cfd1 [tests] rewrite and format several tests on http
Resolve comments in previous cls.
https://dart-review.googlesource.com/c/sdk/+/140564
https://dart-review.googlesource.com/c/sdk/+/136322
https://dart-review.googlesource.com/c/sdk/+/138860

Change-Id: I9549019fe871f35187af5ff75df320748792498b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/141845
Commit-Queue: Zichang Guo <zichangguo@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
2020-04-21 21:41:08 +00:00
Liam Appelbe d78c783d75 [nnbd] Fix corelib/list_test in strong mode
Change-Id: I5dff3bdd62adde0ea78b93e8bf1b747082d6cd8e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/143963
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2020-04-21 21:13:58 +00:00
Erik Ernst ad8ed8bd46 Add test: await voidExpression is an error iff null-safety is enabled.
Change-Id: Ibdd201b595b8835015a1a17417ee1d6e76030676
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144140
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2020-04-21 15:30:03 +00:00
Konstantin Shcheglov 61c8ac8b46 Issue 40088. Promote to NonNull of the declared type on assignment.
Bug: https://github.com/dart-lang/sdk/issues/40088
Change-Id: Icc2c720e24c2e6a85994497cd12bf34957d99d4d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144040
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2020-04-21 03:01:54 +00:00
Konstantin Shcheglov 7e4673f497 Check overrides using only direct superinterfaces.
Change-Id: Ib17c3fb18d6ec4ff4541835a78c645a7b13affd2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142760
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-04-21 02:42:04 +00:00
Ben Konyi de6cfe7e15 [ VM ] Fixed issue where resolving symlinks while trying to get the executable directory path would fail resulting in a "No such file" error
As part of adding support for brew installations, a bug was introduced
which resulted in the executable directory path not being resolved
correctly if the process was launched via a symlink. This resulted in
the script path passed to the CFE not being fully qualified relative to
the executable location which would cause lookup failures for relative
script paths.

Fixes https://github.com/dart-lang/sdk/issues/41329

Change-Id: I31813ccbc024eb0e4dd6dc265986ba3aefd9898e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144005
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2020-04-21 00:09:04 +00:00
Liam Appelbe 3929f299ae [nnbd] Fix json_utf8_chunk_test in strong mode
Change-Id: I1ad9e525520de99dd50cad14f7ed20fa50f50535
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144242
Auto-Submit: Liam Appelbe <liama@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
2020-04-20 23:17:54 +00:00
Konstantin Shcheglov eae75026fa Update tests after rename to UNCHECKED_USE_OF_NULLABLE_VALUE.
R=brianwilkerson@google.com

Change-Id: I51544b0955a906920aa80ae30aa9ecbf80294baf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144006
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-04-20 02:39:25 +00:00
Stephen Adams 7ee0e10bd5 [dart2js] specialize legacy primitive as-checks
Each primitive type T has three variant of 'as' check for 'as T' (strong),
'as T*' (weak) and 'as T?' (nullable).


Change-Id: I6ef3c41d73b384d7d16fa0da0c5b9a1e9791d43f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/143884
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2020-04-18 01:47:37 +00:00
Zichang Guo 18bf8c3560 [dart:io] Fix empty Process.run arguments on Windows
Closes https://github.com/dart-lang/sdk/issues/40060
Change-Id: I3d8c15efea3b24a628846b090701ffd245f09651
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/143700
Commit-Queue: Zichang Guo <zichangguo@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
2020-04-17 20:12:54 +00:00
Liam Appelbe 0d1b98f325 [nnbd] Fix some corelib/list strong mode tests
Change-Id: Ibc2d58ad384e08794d27c96dd0a8c1de56c343ff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/143842
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
2020-04-17 19:29:24 +00:00
Mayank Patke 4e0c699cc4 [dart2js] Update DartType printing of generic function type parameter
bounds to match runtime behavior.

Change-Id: I745a6a84b6d9fc1e0d9c3cc0ded673bafa6ddcd6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/143863
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2020-04-17 11:14:36 +00:00
Johnni Winther 29ac98ea46 [test] Remove use of List constructor in corelib tests
Change-Id: I00777f1db859d075f7dfda21a72e7982d155747e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142371
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2020-04-17 08:45:46 +00:00
Liam Appelbe 2e75c3d7ca [nnbd] Fix remaining async tests in strong mode.
stream_controller_async_test and stream_join_test are built on
async_minitest, so most of the issues were fixed by migrating it to use
Never as the bottom type rather than Null.

Change-Id: I6f43e818a7a8d6793844166c8f9fc07b3b0f7a16
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/143562
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
2020-04-16 21:15:45 +00:00
Nate Bosch 0416cfd075 Add a static error test for default catch type
Static error test for https://github.com/dart-lang/language/issues/922

If the type of the error argument was `dynamic` there would be no error
for calling a method that does not exist.

If the type of the error argument was `Object?` there would be an error
for the call to `_takesObject`.

Change-Id: I3cec1a8ae2903887e5da086cdeecd4008ef5d667
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/143329
Commit-Queue: Nate Bosch <nbosch@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2020-04-16 20:52:45 +00:00
Alexander Markov 12c8b02c84 Reland "[vm/aot/tfa] Tree shake write-only fields"
This relands commit ff34fd8110,
but puts tree shaking of write-only fields under the flag which is
disabled by default.

So far tree shaking was removing fields which are not used at all.
This change improves tree shaking of fields so fields
which are only written or used as interface targets can be removed.

The following limitations apply:

* Field is not removed if there is a constant object with that field, as
  it may impact identity of constant objects which is an observable
  behavior.
* Instance field is not removed if it has a non-trivial initializer as
  it may have side-effects when executed by constructors.
* Late final fields are not removed, as writing such fields may have
  side-effect.
* When field is removed, we may need to introduce an abstract getter
  or abstract setter if field is used as a target of an interface call.
  If a field was written, then setter would be non-abstract (but empty).

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

Change-Id: Iec75b8301892664f4f955a01e5960b17e6620531
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/143286
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-04-16 18:24:05 +00:00
Johnni Winther 2d12821cba [test] Fix various static errors in corelib tests
Change-Id: I762538437b8f68f20c149b737cbe65f212c5c3b5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142370
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2020-04-16 09:20:21 +00:00
Srujan Gaddam 983f882180 [dart:html] Play videos in draw_image_video_element_test
draw_image_video_element_test creates VideoElements, which the current
frame is taken from when drawing to a CanvasElement. The test was
waiting on the onCanPlay event of the VideoElement before drawing,
although this might mean the video won't actually start playing. This
fixes that issue by enabling autoplay and then awaiting the play Event.

Change-Id: I100a552a1eb8e88b6b368d88e499f62f2db8e831
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/143621
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2020-04-16 00:23:23 +00:00
Joshua Litt 1ffc11c7dc [dart2js] Fix for generic_method_type_test.
Change-Id: Icfe460e2abd01a6e2cd4b0bf67709ab44be3881f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/143560
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2020-04-15 19:42:04 +00:00
Liam Appelbe 8829ddc992 [nnbd] Fix the remaining futures tests in strong mode
Change-Id: I5c388b3321a18f62b225d68c295b8d55ab2651fe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142994
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2020-04-15 18:30:23 +00:00
Johnni Winther da95c79901 [cfe] Handle nnbd is-test in constant evaluation
+ detect ~/ evaluation errors

Change-Id: Ic3f979c7516ed9aa2da0eab8b8d902987107c189
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142982
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2020-04-15 17:29:43 +00:00
Leaf Petersen 6d88b04a89 Fix incorrect instance checks.
Several instance checks added during the null safety core library
migration were incorrectly rejecting null values in places where null
values can still flow in legacy mode.  This eliminates the instance
checks in favor of casts which will behave as desired.

Bug: https://github.com/dart-lang/sdk/issues/41465
Change-Id: I50fb9e6cef41d645d5312871932c7168f2d80c29
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/143333
Commit-Queue: Leaf Petersen <leafp@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2020-04-14 19:25:45 +00:00
Liam Appelbe 3083050258 [nnbd] Fix some IO strong mode tests
Fixes:
standalone/io/directory_test
standalone/io/file_test
standalone/io/http_read_test/*
standalone/io/http_reuse_server_port_test/*
standalone/io/http_server_early_client_close_test/*
standalone/io/regress_8828_test/*
standalone/io/socket_cancel_connect_test/*
standalone/io/socket_finalizer_test/*
standalone/io/web_socket_typed_data_test/*

Change-Id: I46b7d8691b66222b61b72bfe4d29ce81fadf511f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/143182
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2020-04-14 18:03:55 +00:00
Johnni Winther dc97454b63 [analyzer,cfe,dart2js] Add pretty printing to id testing
Adds support for pretty printing verbose annotations.
Adds support for force updating annotation texts useful for applying
the pretty printing to valid annotations.

Change-Id: I8fe9b6d2f8198bd5e160854053c8d964ef832a8d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129710
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-04-14 13:24:09 +00:00
Srujan Gaddam 53296536de [dart:html] Add back lib/html/input_element_attributes_test
Now that TextInputElement.value accepts a nullable value, this test
can be added back to test null behavior.

Change-Id: Ia17554314f25c5d09e113bb5c9c0a6b6f1cb1c03
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/143190
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2020-04-14 00:37:41 +00:00