Bug 1319595, part 4 - Fix type checker handling of end points without qualifiers. r=billm
authorAndrew McCreight <continuation@gmail.com>
Tue, 22 Nov 2016 13:55:59 -0800
changeset 324559 86796aaaf1f295563b6c6488cedae7ff2a92f1b7
parent 324558 d056bbc15cf86d7a5e8250bb41789ae153c274f5
child 324560 967d7be10d7a1ceea948a1b1e46d58ec76e8b07f
push id24
push usermaklebus@msu.edu
push dateTue, 20 Dec 2016 03:11:33 +0000
reviewersbillm
bugs1319595
milestone53.0a1
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
ipc/ipdl/ipdl/type.py
--- 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'])),