From 4b733834fc49ddbd6d0b0001e5bfcb14c634151a Mon Sep 17 00:00:00 2001 From: Gus Caplan Date: Fri, 13 Apr 2018 12:22:41 -0700 Subject: [PATCH] util: introduce types.isModuleNamespaceObject PR-URL: https://github.com/nodejs/node/pull/20016 Reviewed-By: Ben Noordhuis Reviewed-By: Guy Bedford Reviewed-By: Colin Ihrig --- src/node_types.cc | 1 + test/parallel/test-util-types.js | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/node_types.cc b/src/node_types.cc index 4b9f86f0d54d8c..bd7ea9cf23fff7 100644 --- a/src/node_types.cc +++ b/src/node_types.cc @@ -34,6 +34,7 @@ namespace { V(SharedArrayBuffer) \ V(Proxy) \ V(WebAssemblyCompiledModule) \ + V(ModuleNamespaceObject) \ #define V(type) \ diff --git a/test/parallel/test-util-types.js b/test/parallel/test-util-types.js index aa45d1604bfe00..924869896869c0 100644 --- a/test/parallel/test-util-types.js +++ b/test/parallel/test-util-types.js @@ -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)); +})();