Skip to content

Commit 0f605c4

Browse files
authored
Fix environment detection in web worker (#103)
1 parent a8898ea commit 0f605c4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/lexer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ function copyLE (src, outBuf16) {
9292

9393
function getWasmBytes() {
9494
const binary = 'WASM_BINARY'; // This string will be replaced by build.js.
95-
if (typeof window !== 'undefined' && typeof atob === 'function')
95+
if ((typeof window !== 'undefined' || typeof self !== 'undefined') && typeof atob === 'function')
9696
return Uint8Array.from(atob(binary), x => x.charCodeAt(0));
9797
return Buffer.from(binary, 'base64');
9898
}

0 commit comments

Comments
 (0)