diff options
| author | Akshay Nair <phenax5@gmail.com> | 2025-05-02 12:04:43 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2025-05-02 16:24:38 +0530 |
| commit | 398b1a4b398324311b6e0f15d2e4ede5ad8500ff (patch) | |
| tree | 4af9a1b5106dc30d22adc0a4391b5ac006dd7141 /src/LuaRuntime.cpp | |
| parent | 8a71de53c002b7afdd516cff7190896d40496483 (diff) | |
| download | null-browser-398b1a4b398324311b6e0f15d2e4ede5ad8500ff.tar.gz null-browser-398b1a4b398324311b6e0f15d2e4ede5ad8500ff.zip | |
Prefix uv with web.uv + add permissions_persistance config option
Diffstat (limited to '')
| -rw-r--r-- | src/LuaRuntime.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/LuaRuntime.cpp b/src/LuaRuntime.cpp index 07ddb67..e9dc86f 100644 --- a/src/LuaRuntime.cpp +++ b/src/LuaRuntime.cpp @@ -35,7 +35,8 @@ void LuaRuntime::start_event_loop() { luv_set_loop(state, event_loop->get_uv_loop()); luv_set_callback(state, &luv_callback); luaopen_luv(state); - lua_setglobal(state, uv_global_name); + lua_setglobal(state, "uv"); + luaL_dostring(state, "web.uv = uv"); } void LuaRuntime::stop_event_loop() { @@ -46,13 +47,13 @@ void LuaRuntime::stop_event_loop() { // Clear the uv global lua_pushnil(state); - lua_setglobal(state, uv_global_name); + lua_setglobal(state, "uv"); lua_gc(state, LUA_GCCOLLECT, 0); } void LuaRuntime::init_web_api() { luaL_newlib(state, internals_api); - lua_setglobal(state, internals_global_name); + lua_setglobal(state, "__internals"); require_module("null-browser.api"); } |
