I have a JavaScript commandline program that needs more stack space. The option for this is node --stack-size
but it's not working for me. Test case:
'use strict'
function f(...a) {
console.log(a[0] + a[a.length - 1])
}
var a = []
for (var i = 0; i < 1000000; i++) {
a.push(i)
}
f(...a)
Run with plain node
, the above crashes with an error message saying maximum call stack size exceeded. But run with node --stack-size=10000
(specifying ten megabytes of stack space, which should be enough) it just exits silently without printing any output, not even an error message.
I'm using Node 14.16.1 x64 on Windows 10.
What am I doing wrong?
echo %errorlevel%
shows -1073741571, which is C00000FD, which is indeed the Windows error code for a stack overflow.