Created
February 9, 2020 02:40
-
-
Save xordspar0/9f7b87fcb297a6a5e537838750182cad to your computer and use it in GitHub Desktop.
Minimal test case for weird love.event behavior
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function love.handlers.myEvent(t) | |
print("In my event handler:") | |
print(getmetatable(t)) | |
print(t.upper) | |
end | |
super = { | |
upper = "hello world" | |
} | |
function love.load() | |
local t = setmetatable({}, {__index = super}) | |
print("My table's metatable:", getmetatable(t)) | |
love.event.push("myEvent", t) | |
end | |
-- It prints this: | |
-- My table's metatable: table: 0x40af88f8 | |
-- In my event handler: | |
-- nil | |
-- nil |
Author
xordspar0
commented
Feb 9, 2020
•
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment