comparison core/src/luan/init.luan @ 229:2a54cb7d1cf4

improve security git-svn-id: https://luan-java.googlecode.com/svn/trunk@230 21e917c8-12df-6dd8-5cb6-c86387c605b9
author fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
date Wed, 24 Sep 2014 21:13:46 +0000
parents 5aafb5b9f70f
children ef39bc4d3f70
comparison
equal deleted inserted replaced
228:7580379cdc79 229:2a54cb7d1cf4
36 local to_string = Package.global(Basic,"to_string") 36 local to_string = Package.global(Basic,"to_string")
37 Package.global(Basic,"type") 37 Package.global(Basic,"type")
38 38
39 do_file "java:luan/version.luan" 39 do_file "java:luan/version.luan"
40 40
41
42 function Package.block(mod_name)
43 local fn,path = Package.search(mod_name)
44 if path == nil then
45 error("module '"..mod_name.."' not found")
46 end
47 Package.block_path(path)
48 end
49
50 function Package.is_blocked(mod_name)
51 local fn,path = Package.search(mod_name)
52 if path == nil then
53 error("module '"..mod_name.."' not found")
54 end
55 return Package.is_blocked_path(path)
56 end
57 41
58 function Io.print_to(out,...) 42 function Io.print_to(out,...)
59 local list = {} 43 local list = {}
60 for _,v in Basic.values(...) do 44 for _,v in Basic.values(...) do
61 list[#list+1] = to_string(v) 45 list[#list+1] = to_string(v)