This means that TypeError no longer inherits a spurious `message` member.
The message of a platform-thrown TypeError is still available as `toString()`.
Fixes#40317
Bug: http://dartbug.com/40317
Change-Id: I77312859ebae3f92c2e56aeea6283b075b71c8d5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136129
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
Only write out the tests if the source files changed, so editors
don't reload files that didn't actually change.
Change-Id: Ifd8621e36aab88b6f0740881a6289bc392a0f52f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134841
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Certain nodes will delimit(..) an Expression to some Statements, which
was resetting the temp nameIndex.
This meant any sub-expressions that generated temps would not cause the
outer expressions to see those already used temps.
Bug: https://github.com/dart-lang/sdk/issues/40662
Change-Id: Ife07052ab756b9d05f34f69380614c7eb7309a4c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136224
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
I think the covers the cases where it seems reasonable for the value
being cast to be null. In the other places where I see casts, it's
pretty clear that a null is an error.
Change-Id: I38e9b47da72579e7f3849284689d4c25b5b14af1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136725
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
TypeArguments::IsUninstantiatedIdentity predicate is checking if
instantiator type arguments could be reused when instantiating
given type arguments (when given type arguments repeat type parameters).
This predicate was not accounting for nullable and legacy type
parameters which could change nullability of types when instantiated.
For example:
class A<T> {}
1. instantiator type arguments [int], instantiating A<T?> results in
[int?] type arguments vector, so instantiator type arguments should
not be reused.
2. instantiator type arguments [int], instantiating A<T*> results in
[int*] type arguments vector so instantiator type arguments should
not be reused.
Change-Id: I1e041486829e8ac0cfd3ce59d0ec5164a0f3724c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136709
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Only '?' is shown by default.
To print '*' and '%', use debugging flag --show-internal-names.
Fix expectations in tests.
Change-Id: Idc60fbfb4d477602eb0c713f4bdcc1e573a3328a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135790
Commit-Queue: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Liam Appelbe <liama@google.com>
This CL:
* Moves [Heap]/[SharedClassTable] from [Isolate] to [IsolateGroup], which
will make all isolates in the group use the same heap. The GC will use
the shared class table for object size information.
* Adds support for entering/leaving an isolate group as a helper thread
(e.g. via [Thread::EnterIsolateGroupAsHelper]). The current active
isolate group can be accessed via TLS `IsolateGroup::Current()` or
`Thread::isolate_group_`. When entering as a helper thread there will be
no current isolate.
* Changes the GC to use the above mechanism and ensures GC works without
a currently active isolate. The GC will use information purely available via
[IsolateGroup]. The GC will iterate all isolates within an isolate
group e.g. for scanning roots.
* Makes spawning of new isolates start in their own isolate group.
Once the isolate is fully functional it's heap will be merged into
the original isolate group
* Moves ApiState, containing persistent and weak persistent handles,
from [Isolate] to [IsolateGroup], plus adds appropriate locking.
Issue https://github.com/dart-lang/sdk/issues/36097
Change-Id: Ia8e1d8aa78750e8400864200f4825395a182c004
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126646
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
This is a reland of 3ef5270f71
Original change's description:
> [VM/runtime] Fix type tests with LHS FutureOr (fixes#38906).
>
> Fixes tests/language_2/subtyping_static/future_or_subtype_test
> Also simplifies code making use of TypeAtNullSafe().
>
> Change-Id: I045a030b2ece9d6980f7a9ba785948f0c10f697b
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135625
> Commit-Queue: Régis Crelier <regis@google.com>
> Reviewed-by: Alexander Markov <alexmarkov@google.com>
Change-Id: Ie3254f6aca3d47a00aead0ac34f3a6b9f301d8dc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136680
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
CSSStyleDeclaration.getPropertyValue returns a non-nullable string.
It will also return an empty string if the property is not found. Since
getPropertyValue returns the value of the native getPropertyValue, the
null check should be removed.
Change-Id: I9846553d3f9fcd68cbd15b9c39d2104cab594b7a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136413
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Change-Id: I893d47262947492d743a2079d82d59c0e9e4e1f1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136707
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
These fixes allow "hello world" to run in NNBD strong mode on the VM.
Change-Id: I3c17b8e1b7ab64086d830298ef8f7601bf1acb68
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136706
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
This CL fixes several minor bugs:
- In info_builder.dart, we were trying to apply SourceInformation from
the defining library to all its parts.
- In NnbdMigrationTestBase, we were trying to fully migrate each file
before processing any other files. We need to prepare each input,
then process each input, then finalize each input.
- In NodeBuilder, we were failing to send part file sources to
NullabilityGraph.migrating(). As a result, methods declared in part
files were being treated as already migrated, so they were getting
the wrong kinds of nullability nodes.
- In _ProvisionalApiTestBase, we were sometimes visiting parts before
discovering what libraries they were part of, causing inconsistent
resolution results.
I'm hoping this will be sufficient to address
https://github.com/dart-lang/sdk/issues/40670.
Change-Id: I07d693b31b6cf64bc6f72126f5ef4792b29e5029
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136521
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Changes include:
* Explicitly declaring Type to prevent extraneous type checks.
* Separating null comparison maps from other type comparison maps.
* Hoisting legacy null comparisons outside of isSubtypeOf and into cast.
Change-Id: Ieb2196261998fdaa1d60f0e97223c1d89bf9ad7b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134879
Commit-Queue: Mark Zhou <markzipan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Preexisting comments on multi-line errors modify the length of the error
reported from the analyzer since it includes the comments in between. So
the error length increases every time you run this script, making the
error comments unwieldly.
Change-Id: Iaeab9118710738f3ebf534d85b7fd08be0bf302f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136526
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Auto-Submit: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Fix assignment of isolate group ids so they are unique.
Change-Id: I921e1169d9800418ff61c17a0765dae7639711e4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136527
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Found via `brew audit --strict --online dart`
Change-Id: Ib38873f51b169526bf10253422ddf79804930984
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136703
Auto-Submit: Kevin Moore <kevmoo@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
This function would iterate vm.isolates twice with an async gap in between and expect no isolates to start or exit in the mean time.
Change-Id: I1a79dd9494a4d0431b112db61c0660ce2df00cca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136560
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
When deduplicating instructions, multiple Code objects may end up
mapping to the same set of program counters, which affects decoding a
stack trace using PC addresses. Since the DWARF stack traces test
depends on the stack trace decoding a certain way, pick a test as a
canary for issues with instruction deduplication that _doesn't_ depend
on how the stack trace will decode.
In previous experience, the underlying test used is unimportant,
so we build off the existing hello world code. If we have an error
due to code inadvertently assuming non-deduplicated instructions,
this error tends to manifest in the VM failing to start up no matter
what code should eventually run.
Fixes https://github.com/dart-lang/sdk/issues/40635
Change-Id: Ife9048740b91dc98b50c8fe4b9ff3dc052dd0a62
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-linux-release-simarm_x64-try,vm-kernel-precomp-mac-release-simarm64-try,vm-kernel-precomp-win-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136122
Commit-Queue: Teagan Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
This is a breaking change. https://github.com/dart-lang/sdk/issues/40483
The Process class will now throw a StateError if the process is detached
upon accessing the exitCode getter. It now also throws when not
connected to the child process's stdio upon accessing the stdin, stdout,
and stderr getters. Previously these getters would all return null.
The getters in question are meaningless for detached processes and there
is no reason to use them in that case. To provide a better experience
when Dart becomes null-safe, these getters are changed to throw and
never return null, which avoids all legitimate uses of the getters from
needing a null check that will never fail.
The NNBD migration required making subtle changes to some dart:io
semantics in order to provide a better API. This change backports one of
these semantic changes to the unmigrated SDK so any issues can be
discovered now instead of blocking the future SDK unfork.
Change-Id: I776e0dc8bcd517d70332c60dd8ab88db17746aa5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134329
Commit-Queue: Jonas Termansen <sortie@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
This reduces the instructions sizes of the Flutter benchmarks by between
0.22% and 0.36% (0.24% for Flutter Gallery) and the total sizes by
between 0.15% and 0.23% (0.15% for Flutter Gallery).
Change-Id: I69c0551883d31afcbaad0f592aafcd3115ecb347
Cq-Do-Not-Cancel-Tryjobs: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135904
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
This makes the register available for the global dispatch table.
Change-Id: Ic77974a1c3e46395b2f8bab6e117187163972221
Cq-Do-Not-Cancel-Tryjobs: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134724
Reviewed-by: Martin Kustermann <kustermann@google.com>
In the legacy SDK these two methods in ListMixin take Object, not E.
When I migrated them to NNBD, I changed them to E to match the
declaration of the methods in List. This was an unintended breaking
change.
Fix that by changing them to "Object?", which is the NNBD equivalent of
the declarations in the legacy SDK.
Change-Id: I2a75e9f26a8198e4f51cb32a55055d5e64a69ed1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136412
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>