Skip to content

Commit c974f1b

Browse files
committed
util: introduce types.isModuleNamespaceObject
PR-URL: #20016 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Guy Bedford <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
1 parent ebe499f commit c974f1b

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/node_types.cc

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ namespace {
3434
V(SharedArrayBuffer) \
3535
V(Proxy) \
3636
V(WebAssemblyCompiledModule) \
37+
V(ModuleNamespaceObject) \
3738

3839

3940
#define V(type) \

test/parallel/test-util-types.js

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Flags: --harmony-bigint
1+
// Flags: --harmony-bigint --experimental-vm-modules
22
/* global SharedArrayBuffer */
33
'use strict';
44
const common = require('../common');
@@ -126,3 +126,11 @@ for (const [ value, _method ] of [
126126
assert.deepStrictEqual(yup, expected[testedFunc]);
127127
}
128128
}
129+
130+
(async () => {
131+
const m = new vm.Module('');
132+
await m.link(() => 0);
133+
m.instantiate();
134+
await m.evaluate();
135+
assert.ok(types.isModuleNamespaceObject(m.namespace));
136+
})();

0 commit comments

Comments
 (0)