Bug 1319595, part 4 - Fix type checker handling of end points without qualifiers. r=billm draft
authorAndrew McCreight <continuation@gmail.com>
Tue, 22 Nov 2016 13:55:59 -0800
changeset 443025 0905d6195a08d3805e10fd05b598321ee0b11038
parent 443024 bfd3758f3f6751cef965cac260d27c54b23445f5
child 443026 3c31432e8c45ae292f4ce086ef151ecd72592e18
push id36884
push userbmo:continuation@gmail.com
push dateWed, 23 Nov 2016 17:11:18 +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'])),