The sandbox's global object
Evaluate code in the sandbox context (global scope)
JavaScript code to execute
Optionalname: stringOptional filename for stack traces
Result of evaluation
Compile and evaluate an ES module in the sandbox context
Module source code
Module name (for stack traces and import resolution)
Module namespace object
Isolated JavaScript context within the same runtime. Each Sandbox has its own global scope — variables and modules in one sandbox cannot pollute another or the main context.
Example