Syntax
getgenv(): tableReturns
| Name | Type | Description |
|---|---|---|
environment | table | The table currently stored at LUA_ENVIRONINDEX for this state. |
Description
Returns the current executor environment table by pushing LUA_ENVIRONINDEX. The function takes no arguments, returns exactly one value, and has no registered alias. Repository call-sites use the returned table to read and write shared executor globals such as __siApiCache and saveinstance.
Call it without parameters. The function reads the needed context from the current runtime state.
It returns environment (table). Use the returns table to separate successful values from nil results and recoverable errors.
Example
Read and write values on the current executor environment table.
local env = getgenv()
env.RealDocsValue = "ready"
print(getgenv().RealDocsValue)