Skip to content

Commit

Permalink
Added some extra checks to make sure we're in a Web Worker.
Browse files Browse the repository at this point in the history
  • Loading branch information
nmrugg committed Nov 9, 2013
1 parent 64ddc86 commit 6313bae
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lzma_worker.js
Expand Up @@ -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) {
Expand Down

0 comments on commit 6313bae

Please sign in to comment.