You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

32 lines
463 B

/*---
{
"custom": true
}
---*/
/*===
finalizer, foo -> 123
===*/
var a;
/* Note: inside function to ensure that no reference to the value can
* be active in temporary registers.
*/
function init() {
a = { foo: 123 };
__duk__.setFinalizer(a, function (x) {
print('finalizer, foo ->', x.foo);
});
}
init();
// refcount finalizing happens here
a = null;
// mark-and-sweep finalizing happens here if refcount disabled
__duk__.gc();