Mercurial Hosting > luan
diff src/luan/modules/Boot.luan @ 1426:94a6a209d4e2
fix
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Sun, 24 Nov 2019 16:38:06 -0700 |
parents | 9ab267b9427c |
children | 56fb5cd8228d |
line wrap: on
line diff
--- a/src/luan/modules/Boot.luan Sun Nov 24 16:04:58 2019 -0700 +++ b/src/luan/modules/Boot.luan Sun Nov 24 16:38:06 2019 -0700 @@ -52,11 +52,7 @@ this.checksum = io.checksum this.charset = io.charset this.set_charset = io.set_charset - - function this.to_uri_string() - return this.uri_string or io.to_uri_string() - end - + this.to_uri_string = io.to_uri_string return this end Boot.new_LuanIn = new_LuanIn @@ -252,7 +248,8 @@ return load(src,file) elseif type(file) == "table" and file.read_text ~= nil then local src = file.read_text() - return load(src,file.to_uri_string()) + local src_file = file.uri_string or file.to_uri_string() + return load(src,src_file) else error("bad argument, expected string or uri table but got "..type(file)) end