We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0f605c4 commit ba0c8fdCopy full SHA for ba0c8fd
src/lexer.js
@@ -92,9 +92,9 @@ function copyLE (src, outBuf16) {
92
93
function getWasmBytes() {
94
const binary = 'WASM_BINARY'; // This string will be replaced by build.js.
95
- if ((typeof window !== 'undefined' || typeof self !== 'undefined') && typeof atob === 'function')
96
- return Uint8Array.from(atob(binary), x => x.charCodeAt(0));
97
- return Buffer.from(binary, 'base64');
+ if (typeof Buffer !== 'undefined')
+ return Buffer.from(binary, 'base64');
+ return Uint8Array.from(atob(binary), x => x.charCodeAt(0));
98
}
99
100
let initPromise;
0 commit comments