Skip to content

Commit 8f734ef

Browse files
authored
fix undefined global (#499)
1 parent 2eb8861 commit 8f734ef

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

build/files.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ const headRegexp = /(^module.exports = \w+;?)/m
179179
/(?:var|const) Buffer = require\('safe-buffer'\)\.Buffer;/
180180
, `
181181
const Buffer = require('safe-buffer').Buffer
182-
const OurUint8Array = global.Uint8Array || function () {}
182+
const OurUint8Array = (typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : typeof self !== 'undefined' ? self : {}).Uint8Array || function () {}
183183
function _uint8ArrayToBuffer(chunk) {
184184
return Buffer.from(chunk);
185185
}

0 commit comments

Comments
 (0)