diff options
author | nshah25 <68348722+nshah25@users.noreply.github.com> | 2021-05-03 22:07:09 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-03 22:07:09 +0200 |
commit | 8be1dd54bb17b3ba3e20960aa3c3f696d09facf7 (patch) | |
tree | 334cf9a2c9f781816f8278c933d66a71bf5c7d88 /Server/Plugins/APIDump/main_APIDump.lua | |
parent | Style: specify include relativity (#5217) (diff) | |
download | cuberite-8be1dd54bb17b3ba3e20960aa3c3f696d09facf7.tar cuberite-8be1dd54bb17b3ba3e20960aa3c3f696d09facf7.tar.gz cuberite-8be1dd54bb17b3ba3e20960aa3c3f696d09facf7.tar.bz2 cuberite-8be1dd54bb17b3ba3e20960aa3c3f696d09facf7.tar.lz cuberite-8be1dd54bb17b3ba3e20960aa3c3f696d09facf7.tar.xz cuberite-8be1dd54bb17b3ba3e20960aa3c3f696d09facf7.tar.zst cuberite-8be1dd54bb17b3ba3e20960aa3c3f696d09facf7.zip |
Diffstat (limited to 'Server/Plugins/APIDump/main_APIDump.lua')
-rw-r--r-- | Server/Plugins/APIDump/main_APIDump.lua | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Server/Plugins/APIDump/main_APIDump.lua b/Server/Plugins/APIDump/main_APIDump.lua index f92abb932..61dd1e66c 100644 --- a/Server/Plugins/APIDump/main_APIDump.lua +++ b/Server/Plugins/APIDump/main_APIDump.lua @@ -52,7 +52,6 @@ end - --- Returns the API currently detected from the global environment local function CreateAPITables() --[[ @@ -121,14 +120,15 @@ local function CreateAPITables() end -- Member variables: + local GetField = a_ClassObj[".get"]; local SetField = a_ClassObj[".set"] or {}; - if ((a_ClassObj[".get"] ~= nil) and (type(a_ClassObj[".get"]) == "table")) then - for k in pairs(a_ClassObj[".get"]) do - if (SetField[k] == nil) then - -- It is a read-only variable, add it as a constant: + if ((GetField ~= nil) and (type(GetField) == "table")) then + for k, v in pairs(GetField) do + if ((SetField[k] == nil) and ((type(v) ~= "table") or (v["__newindex"] == nil))) then + -- It is a read-only variable or array, add it as a constant: table.insert(res.Constants, {Name = k, Value = ""}); else - -- It is a read-write variable, add it as a variable: + -- It is a read-write variable or array, add it as a variable: table.insert(res.Variables, { Name = k }); end end |