Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lib: check SharedArrayBuffer availability in freeze_intrinsics.js #49482

Merged
merged 1 commit into from
Sep 6, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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