Difference between revisions of "Setsafeenv"
From GiderosMobile
(Created page with "__NOTOC__ '''Available since:''' Gideros 2011.6<br/> '''Class:''' (global)<br/> === Description === Sets a safe environment to be used by the given function. <syntaxhighl...") |
(No difference)
|
Revision as of 17:16, 2 February 2025
Available since: Gideros 2011.6
Class: (global)
Description
Sets a safe environment to be used by the given function.
(varies) = setsafeenv(f,table)
f can be a Lua function or a number that specifies the function at that stack level: Level 1 is the function calling setsafeenv. setsafeenv returns the given function.
As a special case, when f is 0 setsafeenv changes the environment of the running thread. In this case, setsafeenv returns no values.
Parameters
f: (varies) function or number(call stack level)
table: (table) environment table to set
Return values
Returns (varies) returns provided function or nil
See also