Skip to content

Commit bb56d8a

Browse files
committed
fix to avoid the 'Unexpected token case' crash on windows
1 parent 7bafcaa commit bb56d8a

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

es5/jsdoc-parse.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ function getJsdocOutput(src, options, done) {
122122
if (!fs.existsSync(jsdocPath)) {
123123
throw Error('jsdoc-parse: cannot find jsdoc: ' + jsdocPath);
124124
}
125-
var args = [jsdocPath, '--pedantic', '-t', jsdocTemplatePath];
125+
var args = ['--pedantic', '-t', jsdocTemplatePath];
126126
if (options.html) {
127127
args = args.concat(['-c', path.resolve(__dirname, 'default-conf.json')]);
128128
} else if (options.conf) {
@@ -134,7 +134,7 @@ function getJsdocOutput(src, options, done) {
134134
var outputFile = fs.openSync(outputFilePath, 'w');
135135
var outputStderrPath = tempPath();
136136
var outputStderr = fs.openSync(outputStderrPath, 'w');
137-
var handle = cp.spawn('node', args, { stdio: [process.stdin, outputFile, outputStderr] });
137+
var handle = cp.spawn(jsdocPath, args, { stdio: [process.stdin, outputFile, outputStderr] });
138138
handle.on('error', done);
139139
handle.on('close', function (code) {
140140
var stderr = fs.readFileSync(outputStderrPath, 'utf8');

lib/jsdoc-parse.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ function getJsdocOutput (src, options, done) {
178178
if (!fs.existsSync(jsdocPath)) {
179179
throw Error('jsdoc-parse: cannot find jsdoc: ' + jsdocPath)
180180
}
181-
var args = [ jsdocPath, '--pedantic', '-t', jsdocTemplatePath ]
181+
var args = [ '--pedantic', '-t', jsdocTemplatePath ]
182182
if (options.html) {
183183
args = args.concat([
184184
'-c',
@@ -196,7 +196,7 @@ function getJsdocOutput (src, options, done) {
196196
var outputFile = fs.openSync(outputFilePath, 'w')
197197
var outputStderrPath = tempPath()
198198
var outputStderr = fs.openSync(outputStderrPath, 'w')
199-
var handle = cp.spawn('node', args, { stdio: [ process.stdin, outputFile, outputStderr ] })
199+
var handle = cp.spawn(jsdocPath, args, { stdio: [ process.stdin, outputFile, outputStderr ] })
200200
handle.on('error', done)
201201
handle.on('close', function (code) {
202202
const stderr = fs.readFileSync(outputStderrPath, 'utf8')

0 commit comments

Comments
 (0)