lib: fix use of --frozen-intrinsics with --jitless

PR-URL: https://github.com/nodejs/node/pull/51248
Fixes: https://github.com/nodejs/node/issues/51232
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
Antoine du Hamel
2023-12-23 13:38:24 +01:00
committed by GitHub
parent f58a31bece
commit 825163c5ab
2 changed files with 14 additions and 9 deletions

View File

@@ -220,13 +220,6 @@ module.exports = function() {
// Other APIs / Web Compatibility
Console.prototype,
WebAssembly.Module.prototype,
WebAssembly.Instance.prototype,
WebAssembly.Table.prototype,
WebAssembly.Memory.prototype,
WebAssembly.CompileError.prototype,
WebAssembly.LinkError.prototype,
WebAssembly.RuntimeError.prototype,
];
const intrinsics = [
// 10.2.4.1 ThrowTypeError
@@ -349,7 +342,6 @@ module.exports = function() {
setInterval,
setTimeout,
console,
WebAssembly,
];
if (typeof SharedArrayBuffer !== 'undefined') { // 25.2
@@ -357,6 +349,19 @@ module.exports = function() {
ArrayPrototypePush(intrinsics, SharedArrayBuffer);
}
if (typeof WebAssembly !== 'undefined') {
ArrayPrototypePush(intrinsicPrototypes,
WebAssembly.Module.prototype,
WebAssembly.Instance.prototype,
WebAssembly.Table.prototype,
WebAssembly.Memory.prototype,
WebAssembly.CompileError.prototype,
WebAssembly.LinkError.prototype,
WebAssembly.RuntimeError.prototype,
);
ArrayPrototypePush(intrinsics, WebAssembly);
}
if (typeof Intl !== 'undefined') {
ArrayPrototypePush(intrinsicPrototypes,
Intl.Collator.prototype,

View File

@@ -1,4 +1,4 @@
// Flags: --frozen-intrinsics
// Flags: --frozen-intrinsics --jitless
'use strict';
require('../common');
const assert = require('assert');