No error output when invoked from command line
mgiuffrida opened this issue · 0 comments
mgiuffrida commented
The Node module doesn't output error messages from the command line. For example, this should result in a parse error, but outputs a blank line nothing and has an error code of 0
:
% echo '{()};&$*#_;' > blah.js
% node node_modules/.bin/google-closure-compiler-js blah.js
% echo $?
0
% node node_modules/.bin/google-closure-compiler-js -v
20161201.0.1
But:
require('google-closure-compiler-js').compile(
{jsCode: [{path: 'blah.js', src: '{()};&$*#_;'}]}
);
{ compiledCode: '',
errors:
[ { file: 'blah.js',
description: 'Parse error. invalid parenthesized expression',
type: 'JSC_PARSE_ERROR',
lineNo: 1,
charNo: 3 } ],
warnings: [] }