quickjs-done/tests/bug648.js

14 lines
369 B
JavaScript
Raw Permalink Normal View History

2025-01-06 20:48:15 +00:00
/*---
negative:
phase: runtime
type: Error
---*/
let finrec = new FinalizationRegistry(v => {})
let object = {object:"object"}
finrec.register(object, {held:"held"}, {token:"token"})
object = undefined
// abrupt termination should not leak |held|
// unfortunately only shows up in qjs, not run-test262,
// but still good to have a regression test
throw Error("ok")