util: introduce types.isModuleNamespaceObject

PR-URL: https://github.com/nodejs/node/pull/20016
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
This commit is contained in:
Gus Caplan 2018-04-13 12:22:41 -07:00
parent ebe499f0c7
commit c974f1bbe8
No known key found for this signature in database
GPG Key ID: F00BD11880E82F0E
2 changed files with 10 additions and 1 deletions

View File

@ -34,6 +34,7 @@ namespace {
V(SharedArrayBuffer) \
V(Proxy) \
V(WebAssemblyCompiledModule) \
V(ModuleNamespaceObject) \
#define V(type) \

View File

@ -1,4 +1,4 @@
// Flags: --harmony-bigint
// Flags: --harmony-bigint --experimental-vm-modules
/* global SharedArrayBuffer */
'use strict';
const common = require('../common');
@ -126,3 +126,11 @@ for (const [ value, _method ] of [
assert.deepStrictEqual(yup, expected[testedFunc]);
}
}
(async () => {
const m = new vm.Module('');
await m.link(() => 0);
m.instantiate();
await m.evaluate();
assert.ok(types.isModuleNamespaceObject(m.namespace));
})();