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: #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]>
  • Loading branch information
miniak authored Sep 6, 2023
1 parent d8eb8d0 commit cfe4166
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 cfe4166

Please sign in to comment.