Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

missing lua module #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions protobuf/protobuf.lua
Original file line number Diff line number Diff line change
Expand Up @@ -749,20 +749,20 @@ local function _AddIsInitializedMethod(message_descriptor, message_meta)

for _,field in ipairs(required_fields) do
if not message_meta._member.HasField(self, field.name) then
errors.append(field.name)
tables.insert(errors, field.name)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

table.insert

end
end

for field, value in message_meta._member.ListFields(self) do
if field.cpp_type == FieldDescriptor.CPPTYPE_MESSAGE then
if field.is_extension then
name = io:format("(%s)", field.full_name)
name = string.format("(%s)", field.full_name)
else
name = field.name
end
if field.label == FieldDescriptor.LABEL_REPEATED then
for i, element in ipairs(value) do
prefix = io:format("%s[%d].", name, i)
prefix = string.format("%s[%d].", name, i)
sub_errors = element:FindInitializationErrors()
for _, e in ipairs(sub_errors) do
errors[#errors + 1] = prefix .. e
Expand Down