google-closure-compiler
Advanced tools
Comparing version 20151015.2.0 to 20151015.3.0
@@ -80,3 +80,3 @@ /* | ||
// Add the gulp-specific argument so the compiler will understand the JSON encoded input | ||
compiler.command_arguments.splice(2, 0, '--json_streams'); | ||
compiler.command_arguments.push('--json_streams'); | ||
@@ -134,4 +134,10 @@ var compiler_process = compiler.run(); | ||
var CHUNK_SIZE = 1024, i = 0; | ||
var num_chunks = Math.ceil(stdInData / CHUNK_SIZE); | ||
var num_chunks = Math.ceil(stdInData.length / CHUNK_SIZE); | ||
compiler_process.stdin.on('error', function(err) { | ||
gulpStream.emit('Error', new PluginError(PLUGIN_NAME, | ||
'Error writing to stdin of the compiler.\n' + err.message)); | ||
cb(); | ||
}); | ||
// Write the data to the stdin stream | ||
@@ -145,3 +151,3 @@ // Be attentive to back-pressure. | ||
if (i < num_chunks) { | ||
ok = compiler_process.stdin.write(stdInData.substr((i - 1) * chunk_size, CHUNK_SIZE), | ||
ok = compiler_process.stdin.write(stdInData.substr((i - 1) * CHUNK_SIZE, CHUNK_SIZE), | ||
"UTF-8"); | ||
@@ -155,3 +161,3 @@ } else { | ||
// write some more once it drains | ||
compiler_process.stdin.once('drain', write_buffer_in_chunks); | ||
compiler_process.stdin.once('drain', write_buffer_in_chunks.bind(null, callback)); | ||
} | ||
@@ -158,0 +164,0 @@ })(function () { |
@@ -41,8 +41,11 @@ /* | ||
for (let i = 0; i < args[key].length; i++) { | ||
this.command_arguments.push('--' + key, args[key][i]); | ||
this.command_arguments.push('--' + key + '=' + | ||
this.escapeArgument(args[key][i])); | ||
} | ||
} else { | ||
this.command_arguments.push('--' + key) | ||
if (args[key] !== null && args[key] !== undefined) { | ||
this.command_arguments.push(args[key]); | ||
this.command_arguments.push('--' + key + '=' + | ||
this.escapeArgument(args[key])); | ||
} else { | ||
this.command_arguments.push('--' + key); | ||
} | ||
@@ -128,2 +131,14 @@ } | ||
/** | ||
* @param {string} arg | ||
* @return {string} | ||
*/ | ||
Compiler.prototype.escapeArgument = function(arg) { | ||
if (arg === true || arg === false || | ||
(arg.substr(0, 1) === '"' && arg.substr(arg.length - 1, 1) === '"')) { | ||
return arg; | ||
} | ||
return '"' + arg.replace(/"/g, '\\"') + '"'; | ||
}; | ||
module.exports = Compiler; |
{ | ||
"name": "google-closure-compiler", | ||
"version": "20151015.2.0", | ||
"version": "20151015.3.0", | ||
"description": "Check, compile, optimize and compress Javascript with Closure-Compiler", | ||
@@ -5,0 +5,0 @@ "repository": { |
# google-closure-compiler | ||
Check, compile, optimize and compress Javascript with Closure-Compiler | ||
This repository tracks issues related to the node publication and associated plugins. | ||
This repository tracks issues related to the publication to npmjs.org and associated plugins. | ||
Any bugs not related to the plugins themselves should be reported to the | ||
@@ -6,0 +6,0 @@ [main repository](https://github.com/google/closure-compiler/). |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
10149837
150118