mirror of
https://github.com/DoneJS-Runtime/quickjs-done-nextgen.git
synced 2025-01-09 17:43:15 +00:00
9c5c441744
Introduced in commit61c8fe6
from last month that moved the callback into the job queue: 1. It leaked `fre->held_val` when no job was enqueued 2. It fumbled the reference count when enqueuing; JS_EnqueueJob already takes care of incrementing and decrementing it Reverts commit0a70623
from earlier today because that didn't turn out to be a complete fix. Fixes: https://github.com/quickjs-ng/quickjs/issues/648
13 lines
369 B
JavaScript
13 lines
369 B
JavaScript
/*---
|
|
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")
|