mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-29 09:24:36 +00:00
Exit nodejs with programResult (#6822)
This commit is contained in:
committed by
Andreas Rumpf
parent
439b72b402
commit
95629acd4d
@@ -1439,7 +1439,11 @@ const
|
||||
## is the value that should be passed to `quit <#quit>`_ to indicate
|
||||
## failure.
|
||||
|
||||
var programResult* {.exportc: "nim_program_result".}: int
|
||||
when defined(nodejs):
|
||||
var programResult* {.importc: "process.exitCode".}: int
|
||||
programResult = 0
|
||||
else:
|
||||
var programResult* {.exportc: "nim_program_result".}: int
|
||||
## modify this variable to specify the exit code of the program
|
||||
## under normal circumstances. When the program is terminated
|
||||
## prematurely using ``quit``, this value is ignored.
|
||||
|
||||
Reference in New Issue
Block a user