We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 930b761 commit 7fde3deCopy full SHA for 7fde3de
mod1.lua
@@ -0,0 +1 @@
1
+return {_NAME="mod1(file)"}
test.fallback.lua
@@ -11,6 +11,18 @@ preload["foo.bar"] = function()
11
return {_NAME="foo.bar"}
12
end
13
14
+preload["fallback.mod1"] = function()
15
+ return {_NAME="mod1(fallback)"}
16
+end
17
+
18
+preload["fallback.mod2"] = function()
19
+ return {_NAME="mod2(fallback)"}
20
21
22
23
24
+assert( _require"mod1"._NAME == "mod1(file)" ) -- the mod1.lua file, not the preload["mod1"] one
25
+assert( _require"mod2"._NAME == "mod2(fallback)" ) -- the fallback mod2 because the mod2.lua is not exists.
26
27
28
assert( require "string" == _require("string") )
0 commit comments