Permalink
Browse files

Added some extra checks to make sure we're in a Web Worker.

  • Loading branch information...
1 parent 64ddc86 commit 6313bae5afab4479406fe6dc30e0cda93f5d0483 @nmrugg nmrugg committed Nov 9, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/lzma_worker.js
View
@@ -3906,7 +3906,7 @@ var LZMA = (function () {
/// Are we in a Web Worker?
/// This seems to be the most reliable way to detect this.
- if (typeof onmessage !== "undefined") {
+ if (typeof onmessage !== "undefined" && (typeof window === "undefined" || typeof window.document === "undefined")) {
(function create_onmessage() {
/// Create the global onmessage function.
onmessage = function (e) {

0 comments on commit 6313bae

Please sign in to comment.