[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: checking userdata type from lua
- From: Javier Guerra <javier@...>
- Date: Thu, 18 May 2006 08:38:38 -0500
On Thursday 18 May 2006 8:23 am, Luiz Henrique de Figueiredo wrote:
> > > That's dangerous. If you expose the registry, you can turn a udata from
> > > one type to another. So you could convert a button to a file and then
> > > call close on it, which will probably crash the host app.
> >
> > isn't this already possible with setmetatable() ?
>
> No, try it! From Lua you can only set the metatables of tables, not of
> udata, precisely to avoid crashing the host app from Lua.
great! and i see getmetatable() does work, making it possible to check the
type.
--
Javier
Attachment:
pgp1Lsu9SHnq_.pgp
Description: PGP signature