You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 8, 2022. It is now read-only.
I think that the target module of a worker (the one indicated in the Worker constructor) should be able to detect that it is the initial module, presumably with (module.id == require.main). In worker.js I have tried setting workerGlobal.require.main = scriptName, but that does not seem to affect the require.main that is provided to the modules in the worker environment. I am not sure how one is supposed to set require.main.
The text was updated successfully, but these errors were encountered:
If you instantiate a Sandbox by calling SANDBOX.sandbox(id, system, options), the id module will be the main. If you instantiate a sandbox with the Sandbox constructor, you can call Sandbox(options).main(id) to start it with that module as the main.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I think that the target module of a worker (the one indicated in the Worker constructor) should be able to detect that it is the initial module, presumably with (module.id == require.main). In worker.js I have tried setting workerGlobal.require.main = scriptName, but that does not seem to affect the require.main that is provided to the modules in the worker environment. I am not sure how one is supposed to set require.main.
The text was updated successfully, but these errors were encountered: