summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGus Caplan <me@gus.host>2018-04-13 12:22:41 -0700
committerGus Caplan <me@gus.host>2018-04-15 12:46:27 -0700
commitc974f1bbe835f66218a15456ca9f8faee6b85c91 (patch)
tree047469fadcbc372fc01ee2f687ad1f1c731e1529
parentebe499f0c7254e3bbb16807d8494229eb21a2eb7 (diff)
downloadandroid-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.cc1
-rw-r--r--test/parallel/test-util-types.js10
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));
+})();