Exit nodejs with programResult (#6822)

This commit is contained in:
Alexander Ivanov
2017-11-28 03:30:49 +02:00
committed by Andreas Rumpf
parent 439b72b402
commit 95629acd4d

View File

@@ -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.