lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Egor wrote:

> The idea is to defer closing "Output" TEXTAREA by temporarily
> redirecting its text to file descriptor #3

Other idea is to modify demo.lua:

1. Load user script in separate environment:
   local env = {}
   setmetatable(env, {__index = _ENV})
   T, E = load(T, "=input", "t", env)
instead of
   T,E=loadstring(T,"=input")

2. Delete and collect user environment after running script (or failing to run):
   env = nil
   collectgarbage()
before line
   write[[</TEXTAREA><P>]]