Skip to content

Commit

Permalink
lib: fix use of --frozen-intrinsics with --jitless
Browse files Browse the repository at this point in the history
PR-URL: #51248
Fixes: #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>
  • Loading branch information
aduh95 authored Dec 23, 2023
1 parent f58a31b commit 825163c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
21 changes: 13 additions & 8 deletions lib/internal/freeze_intrinsics.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -349,14 +342,26 @@ module.exports = function() {
setInterval,
setTimeout,
console,
WebAssembly,
];

if (typeof SharedArrayBuffer !== 'undefined') { // 25.2
ArrayPrototypePush(intrinsicPrototypes, SharedArrayBuffer.prototype);
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,
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-freeze-intrinsics.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Flags: --frozen-intrinsics
// Flags: --frozen-intrinsics --jitless
'use strict';
require('../common');
const assert = require('assert');
Expand Down

0 comments on commit 825163c

Please sign in to comment.