diff --git a/AUTHORS.rst b/AUTHORS.rst index 02cff3c4..b6878644 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -115,6 +115,7 @@ bugs, provided ideas, etc; roughly in order of appearance): * Andrew Janke (https://github.com/apjanke) * Unamer (https://github.com/unamer) * Karl Dahlke (eklhad@gmail.com) +* https://github.com/k3a If you are accidentally missing from this list, send me an e-mail (``sami.vaarala@iki.fi``) and I'll fix the omission. diff --git a/src-input/duk_api_stack.c b/src-input/duk_api_stack.c index 10b3f0b9..9315e241 100644 --- a/src-input/duk_api_stack.c +++ b/src-input/duk_api_stack.c @@ -5930,6 +5930,7 @@ DUK_EXTERNAL duk_idx_t duk_push_heapptr(duk_hthread *thr, void *ptr) { * back to heap_allocated with a few flags cleared, in effect * cancelling the finalizer. */ +#if defined(DUK_USE_FINALIZER_SUPPORT) if (DUK_UNLIKELY(DUK_HEAPHDR_HAS_FINALIZABLE((duk_heaphdr *) ptr))) { duk_heaphdr *curr; @@ -5956,6 +5957,7 @@ DUK_EXTERNAL duk_idx_t duk_push_heapptr(duk_hthread *thr, void *ptr) { /* Continue with the rest. */ } +#endif /* DUK_USE_FINALIZER_SUPPORT */ switch (DUK_HEAPHDR_GET_HTYPE((duk_heaphdr *) ptr)) { case DUK_HTYPE_STRING_INTERNAL: diff --git a/tests/ecmascript/dev/test-dev-finalizers-disabled.js b/tests/ecmascript/dev/test-dev-finalizers-disabled.js new file mode 100644 index 00000000..0be5b5d1 --- /dev/null +++ b/tests/ecmascript/dev/test-dev-finalizers-disabled.js @@ -0,0 +1,11 @@ +/*--- +duktape_config: + DUK_USE_FINALIZER_SUPPORT: false +custom: true +---*/ + +/*=== +undefined +===*/ + +print(typeof Duktape.fin);