Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow vm.Module creators to customize import.meta in the created module #18570

Closed
TimothyGu opened this issue Feb 4, 2018 · 0 comments
Closed
Assignees
Labels
esm Issues and PRs related to the ECMAScript Modules implementation. vm Issues and PRs related to the vm subsystem.

Comments

@TimothyGu
Copy link
Member

In #17560, we added the ability for users to created their own ECMAScript Modules with the vm.Module class (more information can be found in the documentation). However, as of right now the import.meta exposed in vm.Modules is always an empty object:

> module = new vm.Module('import.meta')
Module {
  status: 'uninstantiated',
  linkingStatus: 'unlinked',
  url: 'vm:module(0)',
  context: undefined }
> (node:22093) ExperimentalWarning: vm.Module is an experimental feature. This feature could change at any time
> await module.link(() => {})
undefined
> module.instantiate()
undefined
> var { result } = await module.evaluate()
undefined
> result
{}

Ideally, we would like the callers of vm.Module to be able to customize what import.meta contains in the created module.

@TimothyGu TimothyGu added vm Issues and PRs related to the vm subsystem. esm Issues and PRs related to the ECMAScript Modules implementation. labels Feb 4, 2018
@TimothyGu TimothyGu self-assigned this Feb 4, 2018
punteek added a commit to punteek/node that referenced this issue Mar 30, 2018
@devsnek devsnek closed this as completed in 07ba914 Apr 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
esm Issues and PRs related to the ECMAScript Modules implementation. vm Issues and PRs related to the vm subsystem.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant