I'm no cobol expert, but does this just shell out to
'node -e "' + code + '"'
? What if code contains a " ?https://github.com/IonicaBizau/node.cobol/blob/master/lib/no...
'node -e "' + code + '"'
? What if code contains a " ?https://github.com/IonicaBizau/node.cobol/blob/master/lib/no...
CALL 'EXEC_NODEJS_FILE' USING "example/server.js".
Alternatively, you can escape double quotations to \" and they'll work with node -e (I'm pretty sure it's not doing this automatically though).I think I found another bug too, my only experience with cobol is the 10 minutes spent trying to understand this, so maybe someone can explain? Since in EXEC_NODEJS, NODEJS_CODE is defined as "NODEJS_CODE PIC A(100)", doesn't that limit it to 100 alphabetic characters, so even the example of "console.log('Hello World!')" would not work because of the period, parentheses, and exclamation mark?
That said, COBOL is weakly typed, so you can probably store non-alphabetic characters in a variable typed as alphabetic (at least without the compiler correcting you), but it might fail if you try to do certain operations on them.