Getmetatable: Difference between revisions

From GiderosMobile
No edit summary
No edit summary
Line 2: Line 2:
'''Available since:''' Gideros 2011.6<br/>
'''Available since:''' Gideros 2011.6<br/>
=== Description ===
=== Description ===
If object does not have a metatable, returns nil. Otherwise, if the object's metatable has a "__metatable" field, returns the associated value. Otherwise, returns the metatable of the given object.
<translate>If object does not have a metatable, returns nil. Otherwise, if the object's metatable has a "__metatable" field, returns the associated value. Otherwise, returns the metatable of the given object.</translate>
<source lang="lua">
<source lang="lua">
(table) = getmetatable(object)
(table) = getmetatable(object)
</source>
</source>
=== Parameters ===
=== Parameters ===
'''object''': (object) Object from which to get metatable <br/>
'''object''': (object) <translate>Object from which to get metatable</translate> <br/>
=== Return values ===
=== Return values ===
'''Returns''' (table) metatable<br/>
'''Returns''' (table) <translate>metatable</translate><br/>

Revision as of 12:33, 23 August 2018

Available since: Gideros 2011.6

Description

If object does not have a metatable, returns nil. Otherwise, if the object's metatable has a "__metatable" field, returns the associated value. Otherwise, returns the metatable of the given object.

(table) = getmetatable(object)

Parameters

object: (object) Object from which to get metatable

Return values

Returns (table) metatable