Skip to content

Commit

Permalink
Merge pull request #1782 from MikuAuahDark/dotrequire
Browse files Browse the repository at this point in the history
Show deprecation notice when slashes is passed to require.
  • Loading branch information
slime73 committed Apr 3, 2022
2 parents 730cb08 + 00e4ec1 commit 941fe51
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/modules/filesystem/wrap_Filesystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -806,6 +806,9 @@ int loader(lua_State *L)
{
std::string modulename = luax_checkstring(L, 1);

if (modulename.find('/') != std::string::npos)
luax_markdeprecated(L, 2, "character in require string (forward slashes), use dots instead.", API_CUSTOM);

for (char &c : modulename)
{
if (c == '.')
Expand Down

0 comments on commit 941fe51

Please sign in to comment.