Browse Source

Show deprecation notice when slashes is passed to require.

Closes #1773
Miku AuahDark 3 years ago
parent
commit
00e4ec1e04
1 changed files with 3 additions and 0 deletions
  1. 3 0
      src/modules/filesystem/wrap_Filesystem.cpp

+ 3 - 0
src/modules/filesystem/wrap_Filesystem.cpp

@@ -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 == '.')