FFI: Check for __new metamethod when calling a constructor.
This commit is contained in:
@@ -437,6 +437,12 @@ enum {
|
||||
#define setvmstate(g, st) ((g)->vmstate = ~LJ_VMST_##st)
|
||||
|
||||
/* Metamethods. ORDER MM */
|
||||
#ifdef LJ_HASFFI
|
||||
#define MMDEF_FFI(_) _(new)
|
||||
#else
|
||||
#define MMDEF_FFI(_)
|
||||
#endif
|
||||
|
||||
#ifdef LUAJIT_ENABLE_LUA52COMPAT
|
||||
#define MMDEF_52(_) _(pairs) _(ipairs)
|
||||
#else
|
||||
@@ -450,7 +456,7 @@ enum {
|
||||
/* The following must be in ORDER ARITH. */ \
|
||||
_(add) _(sub) _(mul) _(div) _(mod) _(pow) _(unm) \
|
||||
/* The following are used in the standard libraries. */ \
|
||||
_(metatable) _(tostring) MMDEF_52(_)
|
||||
_(metatable) _(tostring) MMDEF_FFI(_) MMDEF_52(_)
|
||||
|
||||
typedef enum {
|
||||
#define MMENUM(name) MM_##name,
|
||||
|
||||
Reference in New Issue
Block a user