Exit nodejs with programResult (#6822)
This commit is contained in:
parent
439b72b402
commit
95629acd4d
1 changed files with 5 additions and 1 deletions
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue