mirror of
https://github.com/servo/servo.git
synced 2025-06-11 10:00:18 +00:00
Remove an unused argument to needCx and use it in CGCallGenerator.
This commit is contained in:
parent
e34bcaaa5f
commit
3a68b9dbf2
1 changed files with 3 additions and 5 deletions
|
@ -2114,7 +2114,7 @@ class CGDefineDOMInterfaceMethod(CGAbstractMethod):
|
|||
assert!(global.is_not_null());
|
||||
assert!(GetProtoObject(cx, global, global).is_not_null());""")
|
||||
|
||||
def needCx(returnType, arguments, extendedAttributes, considerTypes):
|
||||
def needCx(returnType, arguments, considerTypes):
|
||||
return (considerTypes and
|
||||
(typeNeedsCx(returnType, True) or
|
||||
any(typeNeedsCx(a.type) for a in arguments)))
|
||||
|
@ -2150,8 +2150,7 @@ class CGCallGenerator(CGThing):
|
|||
name = "&" + name
|
||||
args.append(CGGeneric(name))
|
||||
|
||||
needsCx = (typeNeedsCx(returnType, True) or
|
||||
any(typeNeedsCx(a.type) for (a, _) in arguments))
|
||||
needsCx = needCx(returnType, (a for (a, _) in arguments), True)
|
||||
|
||||
if not "cx" in argsPre and needsCx:
|
||||
args.prepend(CGGeneric("cx"))
|
||||
|
@ -4618,8 +4617,7 @@ class CGNativeMember(ClassMethod):
|
|||
assert self.member.isIdentifierLess()
|
||||
args.insert(0, Argument("JS::Value", "aThisVal"))
|
||||
# And jscontext bits.
|
||||
if needCx(returnType, argList, self.extendedAttrs,
|
||||
self.passJSBitsAsNeeded):
|
||||
if needCx(returnType, argList, self.passJSBitsAsNeeded):
|
||||
args.insert(0, Argument("JSContext*", "cx"))
|
||||
# And if we're static, a global
|
||||
if self.member.isStatic():
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue