mirror of
https://github.com/love2d/love.git
synced 2026-08-19 04:06:17 +02:00
Merge pull request #1782 from MikuAuahDark/dotrequire
Show deprecation notice when slashes is passed to require.
This commit is contained in:
@@ -806,6 +806,9 @@ int loader(lua_State *L)
|
|||||||
{
|
{
|
||||||
std::string modulename = luax_checkstring(L, 1);
|
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)
|
for (char &c : modulename)
|
||||||
{
|
{
|
||||||
if (c == '.')
|
if (c == '.')
|
||||||
|
|||||||
Reference in New Issue
Block a user