summary refs log tree commit diff stats
path: root/compiler/nim.nim
diff options
context:
space:
mode:
authorTimothee Cour <timothee.cour2@gmail.com>2021-02-24 12:03:21 -0800
committerGitHub <noreply@github.com>2021-02-24 21:03:21 +0100
commita4e6b242d56d80df004bf625643fcb3c9d3f1b7f (patch)
tree32298bbbeeae4aa4bfa5bed4a3305a744f7041ee /compiler/nim.nim
parent99633d768236ea325c7c6482445ba71c62b30fb0 (diff)
downloadNim-a4e6b242d56d80df004bf625643fcb3c9d3f1b7f.tar.gz
asyncjs: add `then`, `catch` for promise pipelining (#16871)
* asyncjs: add then
* improve tests, changelog, API
* fix cryptic windows error: The parameter is incorrect
* address comments
Diffstat (limited to 'compiler/nim.nim')
-rw-r--r--compiler/nim.nim8
1 files changed, 7 insertions, 1 deletions
diff --git a/compiler/nim.nim b/compiler/nim.nim
index 46654e352..5ec891816 100644
--- a/compiler/nim.nim
+++ b/compiler/nim.nim
@@ -95,9 +95,15 @@ proc handleCmdLine(cache: IdentCache; conf: ConfigRef) =
       var cmdPrefix = ""
       case conf.backend
       of backendC, backendCpp, backendObjc: discard
-      of backendJs: cmdPrefix = findNodeJs() & " "
+      of backendJs:
+        # D20210217T215950:here this flag is needed for node < v15.0.0, otherwise
+        # tasyncjs_fail` would fail, refs https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode
+        cmdPrefix = findNodeJs() & " --unhandled-rejections=strict "
       else: doAssert false, $conf.backend
+      # No space before command otherwise on windows you'd get a cryptic:
+      # `The parameter is incorrect`
       execExternalProgram(conf, cmdPrefix & output.quoteShell & ' ' & conf.arguments)
+      # execExternalProgram(conf, cmdPrefix & ' ' & output.quoteShell & ' ' & conf.arguments)
     of cmdDocLike, cmdRst2html, cmdRst2tex: # bugfix(cmdRst2tex was missing)
       if conf.arguments.len > 0:
         # reserved for future use