mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01: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!(global.is_not_null());
|
||||||
assert!(GetProtoObject(cx, global, 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
|
return (considerTypes and
|
||||||
(typeNeedsCx(returnType, True) or
|
(typeNeedsCx(returnType, True) or
|
||||||
any(typeNeedsCx(a.type) for a in arguments)))
|
any(typeNeedsCx(a.type) for a in arguments)))
|
||||||
|
@ -2150,8 +2150,7 @@ class CGCallGenerator(CGThing):
|
||||||
name = "&" + name
|
name = "&" + name
|
||||||
args.append(CGGeneric(name))
|
args.append(CGGeneric(name))
|
||||||
|
|
||||||
needsCx = (typeNeedsCx(returnType, True) or
|
needsCx = needCx(returnType, (a for (a, _) in arguments), True)
|
||||||
any(typeNeedsCx(a.type) for (a, _) in arguments))
|
|
||||||
|
|
||||||
if not "cx" in argsPre and needsCx:
|
if not "cx" in argsPre and needsCx:
|
||||||
args.prepend(CGGeneric("cx"))
|
args.prepend(CGGeneric("cx"))
|
||||||
|
@ -4618,8 +4617,7 @@ class CGNativeMember(ClassMethod):
|
||||||
assert self.member.isIdentifierLess()
|
assert self.member.isIdentifierLess()
|
||||||
args.insert(0, Argument("JS::Value", "aThisVal"))
|
args.insert(0, Argument("JS::Value", "aThisVal"))
|
||||||
# And jscontext bits.
|
# And jscontext bits.
|
||||||
if needCx(returnType, argList, self.extendedAttrs,
|
if needCx(returnType, argList, self.passJSBitsAsNeeded):
|
||||||
self.passJSBitsAsNeeded):
|
|
||||||
args.insert(0, Argument("JSContext*", "cx"))
|
args.insert(0, Argument("JSContext*", "cx"))
|
||||||
# And if we're static, a global
|
# And if we're static, a global
|
||||||
if self.member.isStatic():
|
if self.member.isStatic():
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue