Skip to content

Commit cfe4166

Browse files
authored
lib: check SharedArrayBuffer availability in freeze_intrinsics.js
PR-URL: #49482 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Yagiz Nizipli <[email protected]>
1 parent d8eb8d0 commit cfe4166

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/internal/freeze_intrinsics.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,6 @@ module.exports = function() {
203203

204204
// 25 Structured Data
205205
ArrayBufferPrototype, // 25.1
206-
SharedArrayBuffer.prototype, // 25.2
207206
DataViewPrototype, // 25.3
208207

209208
// 26 Managing Memory
@@ -309,7 +308,6 @@ module.exports = function() {
309308

310309
// 25 Structured Data
311310
ArrayBuffer, // 25.1
312-
SharedArrayBuffer, // 25.2
313311
DataView, // 25.3
314312
Atomics, // 25.4
315313
// eslint-disable-next-line node-core/prefer-primordials
@@ -354,6 +352,11 @@ module.exports = function() {
354352
WebAssembly,
355353
];
356354

355+
if (typeof SharedArrayBuffer !== 'undefined') { // 25.2
356+
ArrayPrototypePush(intrinsicPrototypes, SharedArrayBuffer.prototype);
357+
ArrayPrototypePush(intrinsics, SharedArrayBuffer);
358+
}
359+
357360
if (typeof Intl !== 'undefined') {
358361
ArrayPrototypePush(intrinsicPrototypes,
359362
Intl.Collator.prototype,

0 commit comments

Comments
 (0)