Fix environment propogation from function to function.

This commit is contained in:
James Roseborough
2008-01-17 00:59:16 +00:00
parent 32d5e9c15e
commit f55a393fb8
2 changed files with 9 additions and 1 deletions

View File

@@ -1,8 +1,16 @@
-- helper file for require() tests
require 'ids'
print( 'in subsample (before module statement)' )
print( 'env', id(getfenv()), '_G', id(_G), '_NAME', _NAME, '_M', id(_M), '_PACKAGE', _PACKAGE )
module( 'req.subsample', package.seeall )
print( 'in subsample (after module statement)' )
print( 'env', id(getfenv()), '_G', id(_G), '_NAME', _NAME, '_M', id(_M), '_PACKAGE', _PACKAGE )
function h()
print 'in subsample.h'
print( 'env', id(getfenv()), '_G', id(_G), '_NAME', _NAME, '_M', id(_M), '_PACKAGE', _PACKAGE )
end
print 'loading subsample.lua'
h()
return 'return value from subsample', 'second return value from subsample'