mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 15:23:51 +00:00
Bug 1223142 - make XPIDL set default nullptrs for optional out parameters, r=bz
--HG-- extra : commitid : 8pSPKD5AdOY extra : transplant_source : %F2%8D%0D%20D4%98%7C%2A%16L%04%C0%88%24%AB%19%19%B2s
This commit is contained in:
parent
f7b2001d62
commit
463f87d708
@ -111,6 +111,19 @@ def paramlistAsNative(m, empty='void'):
|
||||
location=None,
|
||||
realtype=m.realtype)))
|
||||
|
||||
# Set any optional out params to default to nullptr. Skip if we just added
|
||||
# extra non-optional args to l.
|
||||
if len(l) == len(m.params):
|
||||
paramIter = len(m.params) - 1
|
||||
while (paramIter >= 0 and m.params[paramIter].optional and
|
||||
m.params[paramIter].paramtype == "out"):
|
||||
t = m.params[paramIter].type
|
||||
# Strings can't be optional, so this shouldn't happen, but let's make sure:
|
||||
if t == "AString" or t == "ACString" or t == "DOMString" or t == "AUTF8String":
|
||||
break
|
||||
l[paramIter] += " = nullptr"
|
||||
paramIter -= 1
|
||||
|
||||
if len(l) == 0:
|
||||
return empty
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user