mirror of
https://github.com/lune-org/lune.git
synced 2025-05-04 10:43:57 +01:00
bugfix: add support for 'luau.compile'
This commit is contained in:
parent
47a8b5dd14
commit
d5b3277803
1 changed files with 3 additions and 3 deletions
|
@ -52,18 +52,18 @@ fn load_source<'a>(
|
||||||
lua: &'static Lua,
|
lua: &'static Lua,
|
||||||
(source, options): (LuaString<'a>, Option<LuaTable<'a>>),
|
(source, options): (LuaString<'a>, Option<LuaTable<'a>>),
|
||||||
) -> LuaResult<LuaFunction<'a>> {
|
) -> LuaResult<LuaFunction<'a>> {
|
||||||
let mut lua_debug_name = source.to_str()?.to_string();
|
let mut lua_debug_name = None;
|
||||||
|
|
||||||
if let Some(options) = options {
|
if let Some(options) = options {
|
||||||
lua_debug_name = match options.raw_get("debugName")? {
|
lua_debug_name = match options.raw_get("debugName")? {
|
||||||
LuaValue::String(val) => val.to_str()?.to_string(),
|
LuaValue::String(val) => Some(val.to_str()?.to_string()),
|
||||||
_ => lua_debug_name,
|
_ => lua_debug_name,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
let lua_object = lua
|
let lua_object = lua
|
||||||
.load(source.to_str()?.trim_start())
|
.load(source.to_str()?.trim_start())
|
||||||
.set_name(lua_debug_name)
|
.set_name(lua_debug_name.unwrap_or("luau.load(...)".to_string()))
|
||||||
.into_function();
|
.into_function();
|
||||||
|
|
||||||
match lua_object {
|
match lua_object {
|
||||||
|
|
Loading…
Add table
Reference in a new issue