Bug 1825671 - Don't lookup FinalizationRegistry prototype before checking whether...
commitd52c9ae90f24064950cebe22fb53cff2515c3d83
authorJon Coppeard <jcoppeard@mozilla.com>
Thu, 6 Apr 2023 08:17:02 +0000 (6 08:17 +0000)
committerJon Coppeard <jcoppeard@mozilla.com>
Thu, 6 Apr 2023 08:17:02 +0000 (6 08:17 +0000)
tree288e94f2f88ed18113d26353fa739c82e72fa3a8
parent4ca7ebefd5ae7d3b50df28865cb48fde4fb946fd
Bug 1825671 - Don't lookup FinalizationRegistry prototype before checking whether the callback is callable r=sfink

As per the spec, we need to check the callback first:
https://tc39.es/ecma262/#sec-finalization-registry-cleanup-callback

Our internal operations don't line up exactly with spec operations. We do the
lookup in GetPrototypeFromBuiltinConstructor whereas the spec does it in
GetPrototypeFromConstructor which is called from OrdinaryCreateFromConstructor.

Differential Revision: https://phabricator.services.mozilla.com/D174721
js/src/builtin/FinalizationRegistryObject.cpp
js/src/jit-test/tests/gc/bug-1825671.js [new file with mode: 0644]