Fix latent bug it found by prev commit, avoid unexpected callback happen.

maxBuffer’s default is 200*1024 byte in Node.js require('child_process').exec
but…
$ node _infrastructure/tests/typescript/tsc.js --noImplicitAny threejs/three-tests.ts 2>&1 > /dev/null | wc
    1963   21628  291809
over 200KB, when exec method called callback function, but it is not completed yet. exitCode === undefined.
This commit is contained in:
Masahiro Wakame
2013-11-21 17:32:30 +09:00
committed by vvakame
parent c94bdd6794
commit f5e0efcc87
2 changed files with 3 additions and 3 deletions

View File

@@ -59,7 +59,7 @@ var NodeExec = (function () {
result.exitCode = null;
var cmdLine = filename + ' ' + cmdLineArgs.join(' ');
var process = nodeExec(cmdLine, function (error, stdout, stderr) {
var process = nodeExec(cmdLine, { maxBuffer: 1 * 1024 * 1024 }, function (error, stdout, stderr) {
result.stdout = stdout;
result.stderr = stderr;
result.exitCode = error ? error.code : 0;

View File

@@ -57,8 +57,8 @@ class NodeExec implements IExec {
var result = new ExecResult();
result.exitCode = null;
var cmdLine = filename + ' ' + cmdLineArgs.join(' ');
var process = nodeExec(cmdLine, function (error, stdout, stderr) {
var process = nodeExec(cmdLine, {maxBuffer: 1 * 1024 * 1024}, function (error, stdout, stderr) {
result.stdout = stdout;
result.stderr = stderr;
result.exitCode = error ? error.code : 0;