summaryrefslogtreecommitdiff
path: root/lib/internal/vm
diff options
context:
space:
mode:
authorGus Caplan <me@gus.host>2018-07-27 21:21:30 -0500
committerGus Caplan <me@gus.host>2018-07-31 10:23:03 -0500
commit2bdcdfc3cbf735ede8130901f58efcd4c6fe9697 (patch)
tree5f040a87e2f7ef06b67a4ef17a7478a89b5a985a /lib/internal/vm
parent3b23b4d7c08e3e61f7e1ff3b91a6626b2bcfd5e3 (diff)
downloadandroid-node-v8-2bdcdfc3cbf735ede8130901f58efcd4c6fe9697.tar.gz
android-node-v8-2bdcdfc3cbf735ede8130901f58efcd4c6fe9697.tar.bz2
android-node-v8-2bdcdfc3cbf735ede8130901f58efcd4c6fe9697.zip
vm: rename vm.Module to vm.SourceTextModule
At the last TC39 meeting, a new type of Module Records backed by JavaScript source called Dynamic Module Records was discussed, and it is now at Stage 1. Regardless of whether that proposal makes it all the way into the spec, SourceTextModule is indeed a more descriptive and accurate name for what this class represents. PR-URL: https://github.com/nodejs/node/pull/22007 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Jan Krems <jan.krems@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Michaƫl Zasso <targos@protonmail.com> Reviewed-By: Yuta Hiroto <hello@hiroppy.me> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: John-David Dalton <john.david.dalton@gmail.com> Reviewed-By: Bradley Farias <bradley.meck@gmail.com>
Diffstat (limited to 'lib/internal/vm')
-rw-r--r--lib/internal/vm/source_text_module.js (renamed from lib/internal/vm/module.js)13
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/internal/vm/module.js b/lib/internal/vm/source_text_module.js
index a799cf2c34..bea7d7c94a 100644
--- a/lib/internal/vm/module.js
+++ b/lib/internal/vm/source_text_module.js
@@ -44,15 +44,16 @@ const perContextModuleId = new WeakMap();
const wrapMap = new WeakMap();
const dependencyCacheMap = new WeakMap();
const linkingStatusMap = new WeakMap();
-// vm.Module -> function
+// vm.SourceTextModule -> function
const initImportMetaMap = new WeakMap();
-// ModuleWrap -> vm.Module
+// ModuleWrap -> vm.SourceTextModule
const wrapToModuleMap = new WeakMap();
const defaultModuleName = 'vm:module';
-class Module {
+// TODO(devsnek): figure out AbstractModule class or protocol
+class SourceTextModule {
constructor(src, options = {}) {
- emitExperimentalWarning('vm.Module');
+ emitExperimentalWarning('vm.SourceTextModule');
if (typeof src !== 'string')
throw new ERR_INVALID_ARG_TYPE('src', 'string', src);
@@ -229,7 +230,7 @@ class Module {
[customInspectSymbol](depth, options) {
let ctor = getConstructorOf(this);
- ctor = ctor === null ? Module : ctor;
+ ctor = ctor === null ? SourceTextModule : ctor;
if (typeof depth === 'number' && depth < 0)
return options.stylize(`[${ctor.name}]`, 'special');
@@ -244,7 +245,7 @@ class Module {
}
module.exports = {
- Module,
+ SourceTextModule,
initImportMetaMap,
wrapToModuleMap
};