Re: no custom metamethods for cdata

  • From: Mike Pall <mike-1403@xxxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Mon, 31 Mar 2014 23:07:57 +0200

Evan Wies wrote:
> So it appears that the trace aborted here (I use LuaJIT 2.1):
> http://repo.or.cz/w/luajit-2.0.git/blob/refs/heads/v2.1:/src/lj_crecord.c#l722
> 
> If it is an __index operation and there is no metatable, can't it be
> specialized to return nil rather than aborting?

Failed index lookups on cdata types never return nil. They always
raise an error. It doesn't make sense for the compiler to continue
that trace as it'll be aborted by the error raised by the interpreter,
anyway.

--Mike

Other related posts: