diff --git a/lib/utils.js b/lib/utils.js index 7c828fb4..67496a71 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -428,9 +428,9 @@ exports.prepareContent = function(name, inputData, isBinary, isOptimizedBinarySt var promise = external.Promise.resolve(inputData).then(function(data) { - var isBlob = data instanceof Blob || ['[object File]', '[object Blob]'].indexOf(Object.prototype.toString.call(data)) !== -1; + var isBlob = support.blob && (data instanceof Blob || ['[object File]', '[object Blob]'].indexOf(Object.prototype.toString.call(data)) !== -1); - if (support.blob && isBlob && typeof FileReader !== "undefined") { + if (isBlob && typeof FileReader !== "undefined") { return new external.Promise(function (resolve, reject) { var reader = new FileReader(); diff --git a/test/helpers/node-test-utils.js b/test/helpers/node-test-utils.js index 69fbb769..6eb3a6f3 100644 --- a/test/helpers/node-test-utils.js +++ b/test/helpers/node-test-utils.js @@ -12,6 +12,12 @@ global.JSZipTestUtils.loadZipFile = function(name, callback) { }; process.on('uncaughtException', function(err) { console.log('uncaughtException: ' + err, err.stack); + process.exit(1); +}); + +process.on('unhandledRejection', function(err) { + console.log('unhandledRejection: ' + err, err.stack); + process.exit(1); });