98808385d0
The recent rewrite of [0] kept the existing semantics of the finalizer implementation but migrated to the new interop semantics. Turns out in that existing semantics there's a bug, namely that it casted the peer object of to a non-nullable [Object] which is incorrect. This CL * fixes the cast to non-nullable [Object] * moves the (currently) web-specific tests for [Finalizer]/[WeakReference] into `corelib` so it runs on all backends * expands the finalizer tests to check finalizers get invoked * expands the weak reference test to ensure weak reference is cleared [0] https://dart-review.googlesource.com/c/sdk/+/363082/ Issue https://github.com/dart-lang/sdk/issues/55474 Change-Id: Ibd8c186b39100cff9e2f437f1a737034a5364830 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/363581 Reviewed-by: Ömer Ağacan <omersa@google.com> Commit-Queue: Martin Kustermann <kustermann@google.com>