diff --git a/lib/internal/freeze_intrinsics.js b/lib/internal/freeze_intrinsics.js index 2017b8f66e84c0..275d04f7f9891e 100644 --- a/lib/internal/freeze_intrinsics.js +++ b/lib/internal/freeze_intrinsics.js @@ -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, diff --git a/test/parallel/test-freeze-intrinsics.js b/test/parallel/test-freeze-intrinsics.js index 4e20346a9deda8..b3a2503d1d5b40 100644 --- a/test/parallel/test-freeze-intrinsics.js +++ b/test/parallel/test-freeze-intrinsics.js @@ -1,4 +1,4 @@ -// Flags: --frozen-intrinsics +// Flags: --frozen-intrinsics --jitless 'use strict'; require('../common'); const assert = require('assert');