google-closure-compiler
Advanced tools
Comparing version 20160208.3.0 to 20160208.4.0
@@ -109,15 +109,15 @@ /* | ||
// a stream mode of 'IN' | ||
compiler.command_arguments.push('--json_streams', this.streamMode_); | ||
compiler.commandArguments.push('--json_streams', this.streamMode_); | ||
var compiler_process = compiler.run(); | ||
var compilerProcess = compiler.run(); | ||
var stdOutData = '', stdErrData = ''; | ||
compiler_process.stdout.on('data', function (data) { | ||
compilerProcess.stdout.on('data', function (data) { | ||
stdOutData += data; | ||
}); | ||
compiler_process.stderr.on('data', function (data) { | ||
compilerProcess.stderr.on('data', function (data) { | ||
stdErrData += data; | ||
}); | ||
compiler_process.on('close', (function (code) { | ||
compilerProcess.on('close', (function (code) { | ||
// non-zero exit means a compilation error | ||
@@ -171,3 +171,3 @@ if (code !== 0) { | ||
// Error events occur when there was a problem spawning the compiler process | ||
compiler_process.on('error', (function (err) { | ||
compilerProcess.on('error', (function (err) { | ||
this.emit('error', new PluginError(this.PLUGIN_NAME_, | ||
@@ -178,3 +178,3 @@ 'Process spawn error. Is java in the path?\n' + err.message)); | ||
compiler_process.stdin.on('error', (function(err) { | ||
compilerProcess.stdin.on('error', (function(err) { | ||
this.emit('Error', new PluginError(this.PLUGIN_NAME_, | ||
@@ -196,6 +196,6 @@ 'Error writing to stdin of the compiler.\n' + err.message)); | ||
if (i < num_chunks) { | ||
ok = compiler_process.stdin.write(stdInData.substr((i - 1) * CHUNK_SIZE, CHUNK_SIZE), | ||
ok = compilerProcess.stdin.write(stdInData.substr((i - 1) * CHUNK_SIZE, CHUNK_SIZE), | ||
"UTF-8"); | ||
} else { | ||
compiler_process.stdin.write(stdInData.substr((i - 1) * CHUNK_SIZE), "UTF-8", callback); | ||
compilerProcess.stdin.write(stdInData.substr((i - 1) * CHUNK_SIZE), "UTF-8", callback); | ||
} | ||
@@ -206,6 +206,6 @@ } while (i < num_chunks && ok); | ||
// write some more once it drains | ||
compiler_process.stdin.once('drain', write_buffer_in_chunks.bind(null, callback)); | ||
compilerProcess.stdin.once('drain', write_buffer_in_chunks.bind(null, callback)); | ||
} | ||
})(function () { | ||
compiler_process.stdin.end(); | ||
compilerProcess.stdin.end(); | ||
}); | ||
@@ -212,0 +212,0 @@ }; |
@@ -36,5 +36,6 @@ /* | ||
function Compiler(args) { | ||
this.command_arguments = []; | ||
this.commandArguments = []; | ||
if (Array.isArray(args)) { | ||
this.command_arguments = args.slice(); | ||
this.commandArguments = args.slice(); | ||
} else { | ||
@@ -44,7 +45,7 @@ for (var key in args) { | ||
for (var i = 0; i < args[key].length; i++) { | ||
this.command_arguments.push( | ||
this.commandArguments.push( | ||
this.formatArgument(key, args[key][i])); | ||
} | ||
} else { | ||
this.command_arguments.push( | ||
this.commandArguments.push( | ||
this.formatArgument(key, args[key])); | ||
@@ -55,3 +56,3 @@ } | ||
this.command_arguments.unshift('-jar', Compiler.jar_path); | ||
this.commandArguments.unshift('-jar', Compiler.JAR_PATH); | ||
} | ||
@@ -63,3 +64,3 @@ | ||
*/ | ||
Compiler.jar_path = compilerPath; | ||
Compiler.JAR_PATH = compilerPath; | ||
@@ -69,3 +70,3 @@ /** | ||
*/ | ||
Compiler.prototype.java_path = 'java'; | ||
Compiler.prototype.javaPath = 'java'; | ||
@@ -76,3 +77,3 @@ /** @type {function(...*)|null} */ | ||
/** @type {Object<string, string>} */ | ||
Compiler.prototype.spawn_options = undefined; | ||
Compiler.prototype.spawnOptions = undefined; | ||
@@ -88,3 +89,3 @@ /** | ||
var compileProcess = spawn(this.java_path, this.command_arguments, this.spawn_options); | ||
var compileProcess = spawn(this.javaPath, this.commandArguments, this.spawnOptions); | ||
@@ -128,3 +129,3 @@ var stdOutData = '', stdErrData = ''; | ||
Compiler.prototype.getFullCommand = function() { | ||
return this.java_path + ' ' + this.command_arguments.join(' '); | ||
return this.javaPath + ' ' + this.commandArguments.join(' '); | ||
}; | ||
@@ -131,0 +132,0 @@ |
{ | ||
"name": "google-closure-compiler", | ||
"version": "20160208.3.0", | ||
"version": "20160208.4.0", | ||
"description": "Check, compile, optimize and compress Javascript with Closure-Compiler", | ||
@@ -5,0 +5,0 @@ "repository": { |
10556757