Mercurial Hosting > luan
comparison src/luan/modules/Boot.luan @ 1685:46cf5137cb6b
misc fixes
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Wed, 08 Jun 2022 20:13:54 -0600 |
parents | 970e635c7196 |
children | b82767112d8e |
comparison
equal
deleted
inserted
replaced
1684:cfbecf7af56f | 1685:46cf5137cb6b |
---|---|
42 Boot.no_security = no_security | 42 Boot.no_security = no_security |
43 | 43 |
44 | 44 |
45 local local_metatable = { | 45 local local_metatable = { |
46 __index = get_local_cloned | 46 __index = get_local_cloned |
47 __new_index = set_local_cloned | |
47 } | 48 } |
48 function local_metatable.__new_index(tbl,key,value) | |
49 if is_immutable(tbl) then | |
50 set_local_cloned(tbl,key,value) | |
51 else | |
52 raw_set(tbl,key,value) | |
53 end | |
54 end | |
55 Boot.local_metatable = local_metatable | 49 Boot.local_metatable = local_metatable |
56 | 50 |
57 | 51 |
58 local function new_LuanIn(io) | 52 local function new_LuanIn(io) |
59 local this = {} | 53 local this = {} |
102 | 96 |
103 return this | 97 return this |
104 end | 98 end |
105 | 99 |
106 local schemes = {} | 100 local schemes = {} |
107 set_metatable(schemes,local_metatable) | |
108 --LuanTable.setSecurity(schemes,"schemes") | 101 --LuanTable.setSecurity(schemes,"schemes") |
109 | 102 |
110 function schemes.null(path) | 103 function schemes.null(path) |
111 return new_LuanIO( IoLuan.nullIO ) | 104 return new_LuanIO( IoLuan.nullIO ) |
112 end | 105 end |
231 | 224 |
232 function schemes.file(path) | 225 function schemes.file(path) |
233 return new_LuanFile( IoLuan.LuanFile.new(path) ) | 226 return new_LuanFile( IoLuan.LuanFile.new(path) ) |
234 end | 227 end |
235 | 228 |
229 set_metatable(schemes,local_metatable) | |
236 Boot.schemes = schemes | 230 Boot.schemes = schemes |
237 | 231 |
238 | 232 |
239 local function uri(name,options) | 233 local function uri(name,options) |
240 local scheme, location = match( name, "(?s)^([^:]+):(.*)$" ) | 234 local scheme, location = match( name, "(?s)^([^:]+):(.*)$" ) |