mirror of
https://github.com/nodejs/node.git
synced 2025-08-15 21:58:48 +02:00
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>
This commit is contained in:
parent
f8fda0d5ad
commit
6d84ecefcd
4 changed files with 9 additions and 10 deletions
|
@ -109,7 +109,7 @@ async function checkModuleState() {
|
|||
|
||||
{
|
||||
const m = new Module('import "foo";');
|
||||
await m.link(common.mustCall(async (module, specifier) => {
|
||||
await m.link(common.mustCall(async (specifier, module) => {
|
||||
assert.strictEqual(module, m);
|
||||
assert.strictEqual(specifier, 'foo');
|
||||
assert.strictEqual(m.linkingStatus, 'linking');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue