Skip to content

Commit

Permalink
Don't use SharedArrayBuffer if it is not there, #278
Browse files Browse the repository at this point in the history
  • Loading branch information
kriszyp committed Mar 18, 2024
1 parent f350391 commit bd017d7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion write.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ const PROMISE_SUCCESS = Promise.resolve(true);
export const ABORT = 4.452694326329068e-106; // random/unguessable numbers, which work across module/versions and native
export const IF_EXISTS = 3.542694326329068e-103;
const CALLBACK_THREW = {};
const LocalSharedArrayBuffer = typeof Deno != 'undefined' ? ArrayBuffer : SharedArrayBuffer; // Deno can't handle SharedArrayBuffer as an FFI argument due to https://github.com/denoland/deno/issues/12678
const LocalSharedArrayBuffer = typeof Deno != 'undefined' || // Deno can't handle SharedArrayBuffer as an FFI
// argument due to https://github.com/denoland/deno/issues/12678
typeof SharedArrayBuffer == 'undefined' ? // Sometimes electron doesn't have a SharedArrayBuffer
ArrayBuffer : SharedArrayBuffer;
const ByteArray = typeof Buffer != 'undefined' ? function(buffer) { return Buffer.from(buffer) } : Uint8Array;
const queueTask = typeof setImmediate != 'undefined' ? setImmediate : setTimeout; // TODO: Or queueMicrotask?
//let debugLog = []
Expand Down

0 comments on commit bd017d7

Please sign in to comment.