Skip to content

Commit 562947e

Browse files
aduh95richardlau
authored andcommitted
lib: fix use of --frozen-intrinsics with --jitless
PR-URL: #51248 Fixes: #51232 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Vinícius Lourenço Claro Cardoso <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 63aa27d commit 562947e

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

lib/internal/freeze_intrinsics.js

+13-8
Original file line numberDiff line numberDiff line change
@@ -220,13 +220,6 @@ module.exports = function() {
220220

221221
// Other APIs / Web Compatibility
222222
Console.prototype,
223-
WebAssembly.Module.prototype,
224-
WebAssembly.Instance.prototype,
225-
WebAssembly.Table.prototype,
226-
WebAssembly.Memory.prototype,
227-
WebAssembly.CompileError.prototype,
228-
WebAssembly.LinkError.prototype,
229-
WebAssembly.RuntimeError.prototype,
230223
];
231224
const intrinsics = [
232225
// 10.2.4.1 ThrowTypeError
@@ -349,14 +342,26 @@ module.exports = function() {
349342
setInterval,
350343
setTimeout,
351344
console,
352-
WebAssembly,
353345
];
354346

355347
if (typeof SharedArrayBuffer !== 'undefined') { // 25.2
356348
ArrayPrototypePush(intrinsicPrototypes, SharedArrayBuffer.prototype);
357349
ArrayPrototypePush(intrinsics, SharedArrayBuffer);
358350
}
359351

352+
if (typeof WebAssembly !== 'undefined') {
353+
ArrayPrototypePush(intrinsicPrototypes,
354+
WebAssembly.Module.prototype,
355+
WebAssembly.Instance.prototype,
356+
WebAssembly.Table.prototype,
357+
WebAssembly.Memory.prototype,
358+
WebAssembly.CompileError.prototype,
359+
WebAssembly.LinkError.prototype,
360+
WebAssembly.RuntimeError.prototype,
361+
);
362+
ArrayPrototypePush(intrinsics, WebAssembly);
363+
}
364+
360365
if (typeof Intl !== 'undefined') {
361366
ArrayPrototypePush(intrinsicPrototypes,
362367
Intl.Collator.prototype,

test/parallel/test-freeze-intrinsics.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Flags: --frozen-intrinsics
1+
// Flags: --frozen-intrinsics --jitless
22
'use strict';
33
require('../common');
44
const assert = require('assert');

0 commit comments

Comments
 (0)