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
This commit is contained in:
@@ -1427,7 +1427,8 @@ wp_lua_scripting_api_init (lua_State *L)
|
||||
wplua_register_type_methods (L, WP_TYPE_IMPL_MODULE,
|
||||
impl_module_new, NULL);
|
||||
|
||||
wplua_load_uri (L, URI_API, 0, 0, &error);
|
||||
if (G_UNLIKELY (error))
|
||||
if (!wplua_load_uri (L, URI_API, &error) ||
|
||||
!wplua_pcall (L, 0, 0, &error)) {
|
||||
wp_critical ("Failed to load api: %s", error->message);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user