Skip to content

Commit 1feae12

Browse files
committed
crypto: account for disabled SharedArrayBuffer
1 parent 55ff640 commit 1feae12

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/internal/crypto/webidl.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,10 @@ converters.object = (V, opts) => {
180180
};
181181

182182
function isNonSharedArrayBuffer(V) {
183-
return ObjectPrototypeIsPrototypeOf(ArrayBufferPrototype, V);
183+
// SharedArrayBuffers can be disabled with --no-harmony-sharedarraybuffer.
184+
if (SharedArrayBuffer !== undefined)
185+
return ObjectPrototypeIsPrototypeOf(ArrayBufferPrototype, V);
186+
return false;
184187
}
185188

186189
function isSharedArrayBuffer(V) {

0 commit comments

Comments
 (0)