mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 19:38:20 +00:00
API: Accept empty lists as dictionaries
This commit is contained in:
@@ -223,6 +223,11 @@ for i = 1, #functions do
|
|||||||
output:write('\n } else if (args.items['..(j - 1)..'].type == kObjectTypeInteger && args.items['..(j - 1)..'].data.integer >= 0) {')
|
output:write('\n } else if (args.items['..(j - 1)..'].type == kObjectTypeInteger && args.items['..(j - 1)..'].data.integer >= 0) {')
|
||||||
output:write('\n '..converted..' = (handle_T)args.items['..(j - 1)..'].data.integer;')
|
output:write('\n '..converted..' = (handle_T)args.items['..(j - 1)..'].data.integer;')
|
||||||
end
|
end
|
||||||
|
-- accept empty lua tables as empty dictionarys
|
||||||
|
if rt:match('^Dictionary') then
|
||||||
|
output:write('\n } else if (args.items['..(j - 1)..'].type == kObjectTypeArray && args.items['..(j - 1)..'].data.array.size == 0) {')
|
||||||
|
output:write('\n '..converted..' = (Dictionary)ARRAY_DICT_INIT;')
|
||||||
|
end
|
||||||
output:write('\n } else {')
|
output:write('\n } else {')
|
||||||
output:write('\n api_set_error(error, kErrorTypeException, "Wrong type for argument '..j..', expecting '..param[1]..'");')
|
output:write('\n api_set_error(error, kErrorTypeException, "Wrong type for argument '..j..', expecting '..param[1]..'");')
|
||||||
output:write('\n goto cleanup;')
|
output:write('\n goto cleanup;')
|
||||||
|
Reference in New Issue
Block a user