LUA __METATABLED?

I want to know if there is a way to escape the __metatable meta method. I know there is no one, but I am trying to do something like this, but obviously __metatable will prevent this from happening:

-- pretend that there is a __metatable field given to a table
setmetatable(_G, {__index = {None="No indexes"}})< br /> - error: (the string given to the __metatable metamethod)

What I am trying to do here is to escape the __metatable field and just allow myself to set metamethod on _G, which already has one.
I know this is impossible, but I want to ask if there is still a chance to bypass it?

The only way to do this from Lua is to use debug.setmetatable.

The focus of __metatable is protection. The debugging library bypasses this protection (and others), and of course it should be used with caution.

I want to know if there is a way to escape __metatable meta method. I know there is no one, but I am trying to do something like this, but obviously __metatable will prevent this from happening:

-- pretend that there is a __metatable field given to a table
setmetatable(_G, {__index = {None="No indexes"}})
- error: (the string given to the __metatable metamethod)

What I am trying to do here is to escape the __metatable field, and just allow myself to set metatable on _G, it already has one.
I know this is impossible to do, but I want to ask Is there still a chance to bypass it?

The only way to do this from Lua is to use debug.setmetatable.

The focus of __metatable is to protect. Debug library Bypass this protection (and others), and of course should be used with caution.

WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]
SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 3201 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC

Leave a Comment

Your email address will not be published.