Skip to content

Commit

Permalink
util: introduce types.isModuleNamespaceObject
Browse files Browse the repository at this point in the history
PR-URL: #20016
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
  • Loading branch information
devsnek committed Apr 15, 2018
1 parent ebe499f commit c974f1b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/node_types.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ namespace {
V(SharedArrayBuffer) \
V(Proxy) \
V(WebAssemblyCompiledModule) \
V(ModuleNamespaceObject) \


#define V(type) \
Expand Down
10 changes: 9 additions & 1 deletion test/parallel/test-util-types.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Flags: --harmony-bigint
// Flags: --harmony-bigint --experimental-vm-modules
/* global SharedArrayBuffer */
'use strict';
const common = require('../common');
Expand Down Expand Up @@ -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));
})();

0 comments on commit c974f1b

Please sign in to comment.