diff options
author | Gus Caplan <me@gus.host> | 2018-04-13 12:22:41 -0700 |
---|---|---|
committer | Gus Caplan <me@gus.host> | 2018-04-15 12:46:27 -0700 |
commit | c974f1bbe835f66218a15456ca9f8faee6b85c91 (patch) | |
tree | 047469fadcbc372fc01ee2f687ad1f1c731e1529 | |
parent | ebe499f0c7254e3bbb16807d8494229eb21a2eb7 (diff) | |
download | android-node-v8-c974f1bbe835f66218a15456ca9f8faee6b85c91.tar.gz android-node-v8-c974f1bbe835f66218a15456ca9f8faee6b85c91.tar.bz2 android-node-v8-c974f1bbe835f66218a15456ca9f8faee6b85c91.zip |
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>
-rw-r--r-- | src/node_types.cc | 1 | ||||
-rw-r--r-- | test/parallel/test-util-types.js | 10 |
2 files changed, 10 insertions, 1 deletions
diff --git a/src/node_types.cc b/src/node_types.cc index 4b9f86f0d5..bd7ea9cf23 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 aa45d1604b..9248698968 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)); +})(); |