chalk
chalk copied to clipboard
refactor(util): resolve addQuitProc deprecation warning
Like https://github.com/crashappsec/chalk/pull/279, a small PR to get rid of deprecation warnings and reduce noise locally (e.g. when running nimble build -d:debug).
Resolve the deprecation warning:
src/util.nim(59, 3) Warning: use exitprocs.addExitProc; addQuitProc is deprecated [Deprecated]
addQuitProc was deprecated in June 2020, and in Nim 1.4.0.
The rationale was that addQuitProc:
-
"Used
atexit()blindly without making its own callback stack". timotheecour wrote:I'm deprecating
addQuitProcbecause it shouldn't be in system in the first place, and because you can't guarantee a sane ordering (last in first out) if you mix regular vs closure procs; however existing code won't break" - Had a C limitation of 30
atExitcalls. - Didn't work for
-d:js(node and browser).