Skip to content

Commit b978d38

Browse files
committed
Directly check if chunk name isn't equal to '=luau.load' before inserting '@'
1 parent c3a6a4b commit b978d38

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

luau/src/luau.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2682,9 +2682,9 @@ int load_luau(lua_State* L)
26822682
const std::string* bytecode_string = static_cast<std::string*>(luaL_checkudata(L, 1, COMPILE_RESULT_TYPE));
26832683
const char* path = luaL_optlstring(L, 2, "=luau.load", nullptr);
26842684
std::string chunk_name = path;
2685-
if (lua_type(L, 2) == LUA_TSTRING) {
2685+
if (chunk_name != "=luau.load")
26862686
chunk_name.insert(0, "@");
2687-
}
2687+
26882688
luau_load(L, chunk_name.c_str(), bytecode_string->c_str(), bytecode_string->length(), lua_gettop(L) > 2 ? 3 : 0);
26892689

26902690
return 1;

0 commit comments

Comments
 (0)