From a4e6b242d56d80df004bf625643fcb3c9d3f1b7f Mon Sep 17 00:00:00 2001 From: Timothee Cour Date: Wed, 24 Feb 2021 12:03:21 -0800 Subject: 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 --- compiler/nim.nim | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'compiler') 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 -- cgit 1.4.1-2-gfad0