Skip to content

Commit

Permalink
fixup! doc: use top-level await syntax in vm.md
Browse files Browse the repository at this point in the history
Co-authored-by: Darshan Sen <raisinten@gmail.com>
  • Loading branch information
aduh95 and RaisinTen authored Jan 27, 2021
1 parent 5e0b0b8 commit 7d80da4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions doc/api/vm.md
Original file line number Diff line number Diff line change
Expand Up @@ -458,10 +458,10 @@ const bar = new vm.SourceTextModule(`
async function linker(specifier, referencingModule) {
if (specifier === 'foo') {
return new vm.SourceTextModule(`
// The "secret" variable refers to the global variable we added to
// "contextifiedObject" when creating the context.
export default secret;
`, { context: referencingModule.context });
// The "secret" variable refers to the global variable we added to
// "contextifiedObject" when creating the context.
export default secret;
`, { context: referencingModule.context });

// Using `contextifiedObject` instead of `referencingModule.context`
// here would work as well.
Expand Down Expand Up @@ -686,7 +686,7 @@ const module = new vm.SourceTextModule(
meta.prop = {};
}
});
// Since module has no dependencies, the linker function will never be called.
// Since module has no dependencies, the linker function will never be called.
await module.link(() => {});
await module.evaluate();
Expand Down

0 comments on commit 7d80da4

Please sign in to comment.