add Bytearray support to lua::tovalue
This commit is contained in:
@@ -133,6 +133,13 @@ dv::value lua::tovalue(State* L, int idx) {
|
|||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
case LUA_TUSERDATA: {
|
||||||
|
if (auto bytes = touserdata<LuaBytearray>(L, idx)) {
|
||||||
|
const auto& data = bytes->data();
|
||||||
|
return std::make_shared<dv::objects::Bytes>(data.data(), data.size());
|
||||||
|
}
|
||||||
|
[[fallthrough]];
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
throw std::runtime_error(
|
throw std::runtime_error(
|
||||||
"lua type " + std::string(lua_typename(L, type)) +
|
"lua type " + std::string(lua_typename(L, type)) +
|
||||||
|
|||||||
Reference in New Issue
Block a user