From: Daniel Kolesa Date: Thu, 17 Apr 2014 10:50:54 +0000 (+0100) Subject: elua: check for property/method scope in lualian (don't generate code for protected... X-Git-Tag: upstream/1.10.0+1149+ga3a15b1~644^2~188 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5b29cc38e1e16d143d1a1770b9521153525d0d2d;p=platform%2Fupstream%2Fefl.git elua: check for property/method scope in lualian (don't generate code for protected methods as they're only usable within implementations) --- diff --git a/src/bin/elua/modules/lualian.lua b/src/bin/elua/modules/lualian.lua index eeef85d..2cde7ad 100644 --- a/src/bin/elua/modules/lualian.lua +++ b/src/bin/elua/modules/lualian.lua @@ -360,20 +360,24 @@ local gen_contents = function(classn) -- first try properties local props = eolian.class_functions_list_get(classn, ft.PROPERTY) for i, v in ipairs(props) do - local ftype = v:type_get() - local fread = (ftype == ft.PROPERTY or ftype == ft.PROP_GET) - local fwrite = (ftype == ft.PROPERTY or ftype == ft.PROP_SET) - if fwrite then - cnt[#cnt + 1] = Property(v, ft.PROP_SET) - end - if fread then - cnt[#cnt + 1] = Property(v, ft.PROP_GET) + if v:scope_get() == eolian.function_scope.PUBLIC then + local ftype = v:type_get() + local fread = (ftype == ft.PROPERTY or ftype == ft.PROP_GET) + local fwrite = (ftype == ft.PROPERTY or ftype == ft.PROP_SET) + if fwrite then + cnt[#cnt + 1] = Property(v, ft.PROP_SET) + end + if fread then + cnt[#cnt + 1] = Property(v, ft.PROP_GET) + end end end -- then methods local meths = eolian.class_functions_list_get(classn, ft.METHOD) for i, v in ipairs(meths) do - cnt[#cnt + 1] = Method(v) + if v:scope_get() == eolian.function_scope.PUBLIC then + cnt[#cnt + 1] = Method(v) + end end -- and constructors local dflt_ctor = eolian.class_default_constructor_get(classn)