Skip to main content

eval

Function eval 

Source
pub fn eval(source: &str) -> Result<(), String>
Expand description

Compile, load and run source on a fresh Luau VM, mirroring the reference luau CLI (luau_run driver): a fresh state with the standard library open, the chunk loaded into a new thread, and lua_resume to execute it.

Returns Ok(()) if the script ran to completion, or Err(message) carrying the Lua error string (the same text the CLI would print) on a compile, load or runtime error.