Skip to content

Commit

Permalink
lib: check SharedArrayBuffer availability in freeze_intrinsics.js
Browse files Browse the repository at this point in the history
PR-URL: nodejs#49482
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
  • Loading branch information
miniak authored and alexfernandez committed Nov 1, 2023
1 parent 80c867d commit 8ea49be
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/internal/freeze_intrinsics.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,6 @@ module.exports = function() {

// 25 Structured Data
ArrayBufferPrototype, // 25.1
SharedArrayBuffer.prototype, // 25.2
DataViewPrototype, // 25.3

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

// 25 Structured Data
ArrayBuffer, // 25.1
SharedArrayBuffer, // 25.2
DataView, // 25.3
Atomics, // 25.4
// eslint-disable-next-line node-core/prefer-primordials
Expand Down Expand Up @@ -354,6 +352,11 @@ module.exports = function() {
WebAssembly,
];

if (typeof SharedArrayBuffer !== 'undefined') { // 25.2
ArrayPrototypePush(intrinsicPrototypes, SharedArrayBuffer.prototype);
ArrayPrototypePush(intrinsics, SharedArrayBuffer);
}

if (typeof Intl !== 'undefined') {
ArrayPrototypePush(intrinsicPrototypes,
Intl.Collator.prototype,
Expand Down

0 comments on commit 8ea49be

Please sign in to comment.