From 2a18436ca92bc46034fd8a21b2949b3991f4b0a4 Mon Sep 17 00:00:00 2001 From: bptato Date: Mon, 29 Jan 2024 17:27:55 +0100 Subject: js: always use var destructor See https://forum.nim-lang.org/t/10807 --- src/js/javascript.nim | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'src/js') diff --git a/src/js/javascript.nim b/src/js/javascript.nim index f5a00d80..9e814386 100644 --- a/src/js/javascript.nim +++ b/src/js/javascript.nim @@ -1289,20 +1289,14 @@ type template jsDestructor*[U](T: typedesc[ref U]) = static: jsDtors.incl($T) - when NimMajor >= 2: - proc `=destroy`(obj: U) = - nim_finalize_for_js(addr obj) - else: + {.warning[Deprecated]:off.}: proc `=destroy`(obj: var U) = nim_finalize_for_js(addr obj) template jsDestructor*(T: typedesc[object]) = static: jsDtors.incl($T) - when NimMajor >= 2: - proc `=destroy`(obj: T) = - nim_finalize_for_js(addr obj) - else: + {.warning[Deprecated]:off.}: proc `=destroy`(obj: var T) = nim_finalize_for_js(addr obj) -- cgit 1.4.1-2-gfad0