Skip to content

Commit

Permalink
Bug 1515170 - in the IPDL compiler, don't use 'is' for comparing stri…
Browse files Browse the repository at this point in the history
…ngs; r=mccr8

Differential Revision: https://phabricator.services.mozilla.com/D14889
  • Loading branch information
Alex Gaynor committed Dec 18, 2018
1 parent 330e681 commit 99532db
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions ipc/ipdl/ipdl/lower.py
Original file line number Diff line number Diff line change
Expand Up @@ -1013,11 +1013,11 @@ def makeCxxParams(self, paramsems='in', returnsems='out',
|params| and |returns| is the C++ semantics of those: 'in', 'out', or None."""

def makeDecl(d, sems):
if sems is 'in':
if sems == 'in':
return Decl(d.inType(side), d.name)
elif sems is 'move':
elif sems == 'move':
return Decl(d.moveType(side), d.name)
elif sems is 'out':
elif sems == 'out':
return Decl(d.outType(side), d.name)
else:
assert 0
Expand All @@ -1041,12 +1041,12 @@ def makeCallbackRejectDecl(returns):
if paramsems is not None:
cxxparams.extend([makeDecl(d, paramsems) for d in self.params])

if returnsems is 'promise' and self.returns:
if returnsems == 'promise' and self.returns:
pass
elif returnsems is 'callback' and self.returns:
elif returnsems == 'callback' and self.returns:
cxxparams.extend([makeCallbackResolveDecl(self.returns),
makeCallbackRejectDecl(self.returns)])
elif returnsems is 'resolver' and self.returns:
elif returnsems == 'resolver' and self.returns:
cxxparams.extend([makeResolverDecl(self.returns)])
elif returnsems is not None:
cxxparams.extend([makeDecl(r, returnsems) for r in self.returns])
Expand All @@ -1061,31 +1061,31 @@ def makeCxxArgs(self, paramsems='in', retsems='out', retcallsems='out',
assert not retcallsems or retsems # retcallsems => returnsems
cxxargs = []

if paramsems is 'move':
if paramsems == 'move':
cxxargs.extend([p.mayMoveExpr() for p in self.params])
elif paramsems is 'in':
elif paramsems == 'in':
cxxargs.extend([p.var() for p in self.params])
else:
assert False

for ret in self.returns:
if retsems is 'in':
if retcallsems is 'in':
if retsems == 'in':
if retcallsems == 'in':
cxxargs.append(ret.var())
elif retcallsems is 'out':
elif retcallsems == 'out':
cxxargs.append(ExprAddrOf(ret.var()))
else:
assert 0
elif retsems is 'out':
if retcallsems is 'in':
elif retsems == 'out':
if retcallsems == 'in':
cxxargs.append(ExprDeref(ret.var()))
elif retcallsems is 'out':
elif retcallsems == 'out':
cxxargs.append(ret.var())
else:
assert 0
elif retsems is 'resolver':
elif retsems == 'resolver':
pass
if retsems is 'resolver':
if retsems == 'resolver':
cxxargs.append(ExprMove(ExprVar('resolver')))

if not implicit:
Expand Down Expand Up @@ -3055,7 +3055,7 @@ def visitProtocol(self, p):
viz='public'))
self.hdrfile.addthing(CppDirective('include', '"mozilla/WeakPtr.h"'))

if ptype.isToplevel() and self.side is 'parent':
if ptype.isToplevel() and self.side == 'parent':
self.hdrfile.addthings([
_makeForwardDeclForQClass('nsIFile', []),
Whitespace.NL
Expand Down

0 comments on commit 99532db

Please sign in to comment.