Skip to content

Commit 5448499

Browse files
devsnekBridgeAR
authored andcommitted
util: introduce types.isModuleNamespaceObject
PR-URL: nodejs#20016 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
1 parent f5d7f13 commit 5448499

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/node_types.cc

Lines changed: 1 addition & 0 deletions
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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Flags: --experimental-vm-modules
12
/* global SharedArrayBuffer */
23
'use strict';
34
const common = require('../common');
@@ -123,3 +124,11 @@ for (const [ value, _method ] of [
123124
assert.deepStrictEqual(yup, expected[testedFunc]);
124125
}
125126
}
127+
128+
(async () => {
129+
const m = new vm.Module('');
130+
await m.link(() => 0);
131+
m.instantiate();
132+
await m.evaluate();
133+
assert.ok(types.isModuleNamespaceObject(m.namespace));
134+
})();

0 commit comments

Comments
 (0)