Skip to content

Commit 9ff81d2

Browse files
legendecastargos
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 <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Chemi Atlow <[email protected]> Reviewed-By: Ulises Gascón <[email protected]> Reviewed-By: Ethan Arrowood <[email protected]>
1 parent 93e1a33 commit 9ff81d2

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
@@ -1640,8 +1640,8 @@ console.log(`evalResult: '${evalResult}', localVar: '${localVar}'`);
16401640
```
16411641
16421642
Because `vm.runInThisContext()` does not have access to the local scope,
1643-
`localVar` is unchanged. In contrast, [`eval()`][] _does_ have access to the
1644-
local scope, so the value `localVar` is changed. In this way
1643+
`localVar` is unchanged. In contrast, a direct `eval()` call _does_ have access
1644+
to the local scope, so the value `localVar` is changed. In this way
16451645
`vm.runInThisContext()` is much like an [indirect `eval()` call][], e.g.
16461646
`(0,eval)('code')`.
16471647
@@ -2041,10 +2041,10 @@ const { Script, SyntheticModule } = require('node:vm');
20412041
[HostResolveImportedModule]: https://tc39.es/ecma262/#sec-hostresolveimportedmodule
20422042
[ImportDeclaration]: https://tc39.es/ecma262/#prod-ImportDeclaration
20432043
[Link() concrete method]: https://tc39.es/ecma262/#sec-moduledeclarationlinking
2044-
[Module Record]: https://262.ecma-international.org/14.0/#sec-abstract-module-records
2044+
[Module Record]: https://tc39.es/ecma262/#sec-abstract-module-records
20452045
[Source Text Module Record]: https://tc39.es/ecma262/#sec-source-text-module-records
20462046
[Support of dynamic `import()` in compilation APIs]: #support-of-dynamic-import-in-compilation-apis
2047-
[Synthetic Module Record]: https://heycam.github.io/webidl/#synthetic-module-records
2047+
[Synthetic Module Record]: https://tc39.es/ecma262/#sec-synthetic-module-records
20482048
[V8 Embedder's Guide]: https://v8.dev/docs/embed#contexts
20492049
[WithClause]: https://tc39.es/ecma262/#prod-WithClause
20502050
[`ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING_FLAG`]: errors.md#err_vm_dynamic_import_callback_missing_flag
@@ -2064,6 +2064,6 @@ const { Script, SyntheticModule } = require('node:vm');
20642064
[`vm.runInContext()`]: #vmrunincontextcode-contextifiedobject-options
20652065
[`vm.runInThisContext()`]: #vmruninthiscontextcode-options
20662066
[contextified]: #what-does-it-mean-to-contextify-an-object
2067-
[global object]: https://es5.github.io/#x15.1
2068-
[indirect `eval()` call]: https://es5.github.io/#x10.4.2
2067+
[global object]: https://tc39.es/ecma262/#sec-global-object
2068+
[indirect `eval()` call]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/eval#direct_and_indirect_eval
20692069
[origin]: https://developer.mozilla.org/en-US/docs/Glossary/Origin

0 commit comments

Comments
 (0)