summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGus Caplan <me@gus.host>2018-01-30 23:03:56 -0600
committerTimothy Gu <timothygu99@gmail.com>2018-02-03 11:04:34 -0800
commit6d84ecefcd7da51ee5f9613f745ba5d0a9818726 (patch)
tree03249c6fdd9fab8ef4d02e28c45252aa91286ad0 /lib
parentf8fda0d5ada6e391941b328f98e429e51a05ffda (diff)
downloadandroid-node-v8-6d84ecefcd7da51ee5f9613f745ba5d0a9818726.tar.gz
android-node-v8-6d84ecefcd7da51ee5f9613f745ba5d0a9818726.tar.bz2
android-node-v8-6d84ecefcd7da51ee5f9613f745ba5d0a9818726.zip
vm: flip Module#link's signature
The specifier parameter is deemed to be more essential than referencingModule. Flipping the parameter order allows developers to write simple linker functions that only take in a specifier. PR-URL: https://github.com/nodejs/node/pull/18471 Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Michaƫl Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Diffstat (limited to 'lib')
-rw-r--r--lib/internal/vm/Module.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/internal/vm/Module.js b/lib/internal/vm/Module.js
index a8625ef76b..2f139d8b26 100644
--- a/lib/internal/vm/Module.js
+++ b/lib/internal/vm/Module.js
@@ -135,7 +135,7 @@ class Module {
const promises = [];
wrap.link((specifier) => {
const p = (async () => {
- const m = await linker(this, specifier);
+ const m = await linker(specifier, this);
if (!m || !wrapMap.has(m))
throw new errors.Error('ERR_VM_MODULE_NOT_MODULE');
if (m.context !== this.context)