webmcp

diff framework/env/execute/file_path.lua @ 309:4e69ce9a6365

Mechanism to load, compile, and cache Lua code from the filesystem
author jbe
date Sun Mar 22 22:25:37 2015 +0100 (2015-03-22)
parents 82cc171e8510
children ba68ef9e7c90
line diff
     1.1 --- a/framework/env/execute/file_path.lua	Sun Mar 22 20:39:13 2015 +0100
     1.2 +++ b/framework/env/execute/file_path.lua	Sun Mar 22 22:25:37 2015 +0100
     1.3 @@ -1,7 +1,7 @@
     1.4  --[[--
     1.5  status_code =             -- status code returned by the executed lua file (a string)
     1.6  execute.file_path{
     1.7 -  file_path = file_path,  -- path to a lua source or byte-code file
     1.8 +  file_path = file_path,  -- path to a Lua source or byte-code file
     1.9    id        = id,         -- id to be returned by param.get_id(...) during execution
    1.10    params    = params      -- parameters to be returned by param.get(...) during execution
    1.11  }
    1.12 @@ -14,7 +14,7 @@
    1.13    local file_path = args.file_path
    1.14    local id        = args.id
    1.15    local params    = args.params
    1.16 -  local func, load_errmsg = loadfile(file_path, nil, _ENV)
    1.17 +  local func, load_errmsg = loadcached(file_path)
    1.18    if not func then
    1.19      error('Could not load file "' .. file_path .. '": ' .. load_errmsg)
    1.20    end

Impressum / About Us