Commit Graph

9 Commits

Author SHA1 Message Date
George Kiagiadakis
c6c740e94a wplua: expose setmetatable / getmetatable in the sandbox 2023-04-17 07:48:18 -04:00
Michael Olbrich
13b85bd4a2 m-lua-scripting: fix object refcounting
7908b8d7be2a2992c57cd549054eda7ce46e4b44 ("m-lua-scripting: allow
converting GValue holding NULL objects to Lua") accidentally added a second
refcount. As a result, the objects are never freeded.

Remove the second refcount to fix this.
2022-05-24 11:40:35 +02:00
Julian Bouzas
c2f31bb550 m-lua-scripting: allow converting GValue holding NULL objects to Lua 2022-05-19 07:43:12 -04:00
George Kiagiadakis
81af8c2069 lua: sandbox: remove all traces of the minimal_std flag, as it's no longer used 2022-04-23 20:14:59 +03:00
George Kiagiadakis
031bc65c20 lua: sandbox: relax the sandbox to allow more functionality in scripts
This enables the debug and coroutine libraries and some more functions
that are not really so risky to have around

Related to #121
2022-04-23 20:14:59 +03:00
George Kiagiadakis
9387ce0d95 wplua: implement reference counting of the lua_State 2022-04-23 20:14:59 +03:00
George Kiagiadakis
9c22f6076a wplua: enable the use of require() to load lua libraries from scripts/lib 2022-04-23 20:14:59 +03:00
George Kiagiadakis
e1d0240bc9 wplua: split the functionality of the load functions into smaller functions
The load functions used to do 3 things:
- push the sandbox function on the stack
- load the file and push it as a function on the stack
- call the sandbox (or the file)

Now there are separate functions to do these 3:
- wplua_push_sandbox
- wplua_load_*
- wplua_pcall
2022-04-23 20:14:59 +03:00
George Kiagiadakis
17a257ddbe wplua: move under modules/module-lua-scripting
It's unlikely that wplua will ever be useful outside the context
of module-lua-scripting, so let's move it to keep all the code in one place
2022-03-24 09:47:59 +02:00