Bug 1319595, part 4 - Fix type checker handling of end points without qualifiers. r=billm
If qname has no quals, then fullname would be None, which breaks the
string concatenation in parentEndpointDecl and childEndpointDecl, even
if no endpoints are declared. This patch uses the short name if there
are no quals, while preserving the behavior that we want to pass None
into declare for fullname.
MozReview-Commit-ID: 9nuO8GWhBRH
--- a/ipc/ipdl/ipdl/type.py
+++ b/ipc/ipdl/ipdl/type.py
@@ -704,26 +704,23 @@ class GatherDecls(TcheckVisitor):
p = tu.protocol
# FIXME/cjones: it's a little weird and counterintuitive
# to put both the namespace and non-namespaced name in the
# global scope. try to figure out something better; maybe
# a type-neutral |using| that works for C++ and protocol
# types?
qname = p.qname()
- if 0 == len(qname.quals):
- fullname = None
- else:
- fullname = str(qname)
+ fullname = str(qname)
p.decl = self.declare(
loc=p.loc,
type=ProtocolType(qname, p.nestedRange, p.sendSemantics,
stateless=(0 == len(p.transitionStmts))),
shortname=p.name,
- fullname=fullname)
+ fullname=None if 0 == len(qname.quals) else fullname)
p.parentEndpointDecl = self.declare(
loc=p.loc,
type=EndpointType(QualifiedId(p.loc, 'Endpoint<' + fullname + 'Parent>', ['mozilla', 'ipc'])),
shortname='Endpoint<' + p.name + 'Parent>')
p.childEndpointDecl = self.declare(
loc=p.loc,
type=EndpointType(QualifiedId(p.loc, 'Endpoint<' + fullname + 'Child>', ['mozilla', 'ipc'])),