What's wrong with Buffer class in Luvit?

33 views
Skip to first unread message

Dmitri Voronianski

unread,
Oct 21, 2016, 2:46:18 PM10/21/16
to luvit
I'm searching a way to detect Buffer in Luvit. However this code is not working:

local instanceof = require('core').instanceof
local Buffer = require('buffer').Buffer
local b = Buffer:new('chunk')

p(b)
-- { ctype = cdata<unsigned char *>: 0x7feda4701bc0, length = 5 }
p(instanceof(b, Buffer))
-- false (WTF?)


Core's instanceof method (https://luvit.io/api/core.html#core_core_instanceof_obj_class) returns `false` where it should be true obviously.
Reply all
Reply to author
Forward
0 new messages