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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
_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>
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>
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>
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>
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>
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>
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>
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>
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>
- 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>
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>
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>
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>
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>
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>
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>
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>
- 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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
- 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/41206https://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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>