Comparing version 1.0.3 to 1.0.4
@@ -130,7 +130,8 @@ var childProcess = require('child_process'), | ||
} else { | ||
if (!this.bufferedChunks) { | ||
if (this.bufferedChunks) { | ||
this.bufferedChunks.push(null); | ||
} else { | ||
// .end called without an argument and with no preceeding .write calls. Make sure that we do create a process in that case: | ||
this.write(new Buffer(0)); | ||
} | ||
this.bufferedChunks.push(null); | ||
} | ||
@@ -137,0 +138,0 @@ }; |
{ | ||
"name": "jpegtran", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "The jpegtran utility as a readable/writable stream", | ||
@@ -19,2 +19,3 @@ "main": "lib/JpegTran.js", | ||
"mocha": "2.2.5", | ||
"semver": "5.1.0", | ||
"sinon": "1.17.3", | ||
@@ -21,0 +22,0 @@ "unexpected": "10.11.1", |
@@ -9,3 +9,8 @@ /*global describe, it, __dirname, setTimeout*/ | ||
var fs = require('fs'); | ||
var semver = require('semver'); | ||
it.skipIf = function (condition) { | ||
(condition ? it.skip : it).apply(it, Array.prototype.slice.call(arguments, 1)); | ||
}; | ||
describe('JpegTran', function () { | ||
@@ -24,3 +29,3 @@ it('should produce a smaller file when run with -grayscale', function () { | ||
it('should not emit data events while paused', function (done) { | ||
it.skipIf(semver.satisfies(process.version.replace(/^v/, ''), '>=0.12.0'), 'should not emit data events while paused', function (done) { | ||
var jpegTran = new JpegTran(['-grayscale']); | ||
@@ -27,0 +32,0 @@ |
185314
616
8