Improve compatibility across contexts: nodejs, web ui and web worker

This commit is contained in:
Eric Vergnaud 2015-09-04 00:19:34 +08:00
parent e7cdc2271f
commit 6c0b7d9c87
1 changed files with 1 additions and 1 deletions

View File

@ -34,7 +34,7 @@
// when you construct the object.
//
var InputStream = require('./InputStream').InputStream;
var isNodeJs = typeof window === 'undefined';
var isNodeJs = typeof window === 'undefined' && importScripts === 'undefined';
var fs = isNodeJs ? require("fs") : null;
function FileStream(fileName) {