Skip to content

Using the same VM instance for isolated contexts #331

Answered by khvzak
RGBCube asked this question in Q&A
Discussion options

You must be logged in to vote

You could try setting sandbox mode for Luau and executing each chunk in isolated environment.

There are few options:

  1. Setting sandbox before executing chunk and then destroyng it (exactly as in the doc example)
  2. Setting sandbox and then utilizing per-Thread sandbox see this doc. Sorry it's a hidden functionality but should work!
  3. Setting sandbox and then setting isolated proxy environment to a chunk.

You can even make environment readonly and prevent any writes to globals.

Personally I would try №3

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@RGBCube
Comment options

Answer selected by RGBCube
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants