━ Vital::Sandbox::JS::create()
@Objective: Creates a new VM.
vital_vm* vm = new Vital::Sandbox::JS::create();
━ Vital::Sandbox::JS::fetchVM()
@Objective: Retrieves vm by its state's reference.
vital_vm* vm = Vital::Sandbox::JS::fetchVM(vital_ref* vm);
@Objective: Destroys targetted vm.
bool result = vm -> destroy();
@Objective: Pops specified number of values from top of the stack.
void result = vm -> pop(int count = 1);
@Objective: Executes a C++ function safely on the vm while reporting encountered exceptions.
⚠️ To be used only within bound C++ functions.
int result = vm -> execute(std::function<int()> exec);
@Objective: Runs specified buffer on the vm.
bool result = vm -> loadString(std::string& buffer);
@Objective: Throws a error with call stack details.
bool result = vm -> throwError(std::string& error = "");