Skip to content

Commit cd6bc98

Browse files
legendecasaduh95
authored andcommitted
doc: update vm doc links
Synthetic Module Record is defined in the ECMA262. Link indirect eval calls to MDN with rich examples. PR-URL: #58885 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Chemi Atlow <chemi@atlow.co.il> Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com> Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
1 parent 114cd95 commit cd6bc98

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

doc/api/vm.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1555,8 +1555,8 @@ console.log(`evalResult: '${evalResult}', localVar: '${localVar}'`);
15551555
```
15561556
15571557
Because `vm.runInThisContext()` does not have access to the local scope,
1558-
`localVar` is unchanged. In contrast, [`eval()`][] _does_ have access to the
1559-
local scope, so the value `localVar` is changed. In this way
1558+
`localVar` is unchanged. In contrast, a direct `eval()` call _does_ have access
1559+
to the local scope, so the value `localVar` is changed. In this way
15601560
`vm.runInThisContext()` is much like an [indirect `eval()` call][], e.g.
15611561
`(0,eval)('code')`.
15621562
@@ -1954,10 +1954,10 @@ const { Script, SyntheticModule } = require('node:vm');
19541954
[GetModuleNamespace]: https://tc39.es/ecma262/#sec-getmodulenamespace
19551955
[HostResolveImportedModule]: https://tc39.es/ecma262/#sec-hostresolveimportedmodule
19561956
[Link() concrete method]: https://tc39.es/ecma262/#sec-moduledeclarationlinking
1957-
[Module Record]: https://262.ecma-international.org/14.0/#sec-abstract-module-records
1957+
[Module Record]: https://tc39.es/ecma262/#sec-abstract-module-records
19581958
[Source Text Module Record]: https://tc39.es/ecma262/#sec-source-text-module-records
19591959
[Support of dynamic `import()` in compilation APIs]: #support-of-dynamic-import-in-compilation-apis
1960-
[Synthetic Module Record]: https://heycam.github.io/webidl/#synthetic-module-records
1960+
[Synthetic Module Record]: https://tc39.es/ecma262/#sec-synthetic-module-records
19611961
[V8 Embedder's Guide]: https://v8.dev/docs/embed#contexts
19621962
[`ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING_FLAG`]: errors.md#err_vm_dynamic_import_callback_missing_flag
19631963
[`ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING`]: errors.md#err_vm_dynamic_import_callback_missing
@@ -1975,6 +1975,6 @@ const { Script, SyntheticModule } = require('node:vm');
19751975
[`vm.runInContext()`]: #vmrunincontextcode-contextifiedobject-options
19761976
[`vm.runInThisContext()`]: #vmruninthiscontextcode-options
19771977
[contextified]: #what-does-it-mean-to-contextify-an-object
1978-
[global object]: https://es5.github.io/#x15.1
1979-
[indirect `eval()` call]: https://es5.github.io/#x10.4.2
1978+
[global object]: https://tc39.es/ecma262/#sec-global-object
1979+
[indirect `eval()` call]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/eval#direct_and_indirect_eval
19801980
[origin]: https://developer.mozilla.org/en-US/docs/Glossary/Origin

0 commit comments

Comments
 (0)