From 5e7946fe79193633e9a78aae48548635cbc11023 Mon Sep 17 00:00:00 2001 From: Gus Caplan Date: Mon, 9 Sep 2019 12:20:16 -0500 Subject: vm: refactor SourceTextModule MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Removes redundant `instantiate` method - Refactors `link` to match the spec linking steps more accurately - Removes URL validation from SourceTextModule specifiers - DRYs some dynamic import logic Closes: https://github.com/nodejs/node/issues/29030 Co-Authored-By: Michaël Zasso PR-URL: https://github.com/nodejs/node/pull/29776 Reviewed-By: James M Snell Reviewed-By: Michaël Zasso Reviewed-By: Minwoo Jung --- doc/api/errors.md | 10 +++--- doc/api/vm.md | 103 ++++++++++++++---------------------------------------- 2 files changed, 32 insertions(+), 81 deletions(-) (limited to 'doc') diff --git a/doc/api/errors.md b/doc/api/errors.md index 34412648b3..4e76673723 100644 --- a/doc/api/errors.md +++ b/doc/api/errors.md @@ -1984,11 +1984,6 @@ than the parent module. Linked modules must share the same context. The linker function returned a module for which linking has failed. - -### ERR_VM_MODULE_NOT_LINKED - -The module must be successfully linked before instantiation. - ### ERR_VM_MODULE_NOT_MODULE @@ -2275,6 +2270,11 @@ removed: v10.0.0 Used when a given value is out of the accepted range. + +### ERR_VM_MODULE_NOT_LINKED + +The module must be successfully linked before instantiation. + ### ERR_ZLIB_BINDING_CLOSED