lib: check SharedArrayBuffer availability in freeze_intrinsics.js

PR-URL: https://github.com/nodejs/node/pull/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>
This commit is contained in:
Milan Burda 2023-09-06 11:19:29 +02:00 committed by GitHub
parent d8eb8d05f9
commit cfe4166f0f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -203,7 +203,6 @@ module.exports = function() {
// 25 Structured Data
ArrayBufferPrototype, // 25.1
SharedArrayBuffer.prototype, // 25.2
DataViewPrototype, // 25.3
// 26 Managing Memory
@ -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
@ -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,