03-01-2014, 09:45 PM
Not really, because files may reference one another's globals.
For example, our Info.lua file references all the command handlers, that are defined in all the other files. That's why we load Info.lua as the last one - the functions wouldn't be defined otherwise.
Simple example:
However, if b.lua is loaded first and a.lua second, then the Test() function is undefined when b.lua is executed, and the code won't work. I'd expect a warning from the analyzer that b.lua is using an unknown global.
For example, our Info.lua file references all the command handlers, that are defined in all the other files. That's why we load Info.lua as the last one - the functions wouldn't be defined otherwise.
Simple example:
-- a.lua: function Test() end -- b.lua Test()If a.lua is loaded first, b.lua second, the entire code works and I wouldn't expect any message from the analyzer.
However, if b.lua is loaded first and a.lua second, then the Test() function is undefined when b.lua is executed, and the code won't work. I'd expect a warning from the analyzer that b.lua is using an unknown global.