Syntax
getrawmetatable(target: any): table | nilAliases
debug.getmetatableArguments
| Name | Type | Description |
|---|---|---|
target | any | Target function, table, stack level, or object being inspected or changed. |
Returns
| Name | Type | Description |
|---|---|---|
metatable | table | nil | Raw metatable, or nil when one is not available. |
Description
Returns the raw metatable for a target value.
Call it with 1 parameter(s): target. The argument table explains which values are required and which ones only refine the behavior.
It returns metatable (table | nil). Use the returns table to separate successful values from nil results and recoverable errors.
Example
Example call with placeholder values.
local result = getrawmetatable(nil)
print(result)