creationix/luvit — Issue #20: node-ish modules
Author: dvv
Created: 2011-10-21 16:32:27+00:00
State: open

subj is needed. with the recent changes, `require('./foo')` loads the file beside the file which does the `require`. However, the following lazy loader won't work:

root/lib/mod.lua
```
return {
use = function(name) return require('./' .. name) end
}
```

root/server.lua
```
local Mod = require('./lib/mod') -- works ok
local foo = Mod.use('bar') -- doesn't load 'root/lib/bar', instead tries to load 'root/bar', because the source file is 'root/server.lua'
```