mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
script: Mark callback methods with CanGc. (#35753)
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
This commit is contained in:
parent
3d320fa96a
commit
5650fa2e79
26 changed files with 133 additions and 67 deletions
|
@ -417,6 +417,10 @@ DOMInterfaces = {
|
|||
'canGc': ['CloneNode', 'SetTextContent'],
|
||||
},
|
||||
|
||||
'NodeIterator': {
|
||||
'canGc': ['NextNode', 'PreviousNode'],
|
||||
},
|
||||
|
||||
'Notification': {
|
||||
'canGc': ['RequestPermission'],
|
||||
},
|
||||
|
@ -518,6 +522,10 @@ DOMInterfaces = {
|
|||
'canGc': ['Encode']
|
||||
},
|
||||
|
||||
'TreeWalker': {
|
||||
'canGc': ['ParentNode', 'PreviousNode', 'NextNode', 'FirstChild', 'LastChild', 'PreviousSibling', 'NextSibling']
|
||||
},
|
||||
|
||||
'URL': {
|
||||
'weakReferenceable': True,
|
||||
'canGc': ['Parse', 'SearchParams'],
|
||||
|
@ -598,7 +606,7 @@ DOMInterfaces = {
|
|||
},
|
||||
|
||||
'XRTest': {
|
||||
'canGc': ['SimulateDeviceConnection', 'DisconnectAllDevices'],
|
||||
'canGc': ['SimulateDeviceConnection', 'DisconnectAllDevices', 'SimulateUserActivation'],
|
||||
},
|
||||
|
||||
'XRView': {
|
||||
|
|
|
@ -7931,7 +7931,7 @@ class CGCallback(CGClass):
|
|||
args = args[2:]
|
||||
# Record the names of all the arguments, so we can use them when we call
|
||||
# the private method.
|
||||
argnames = [arg.name for arg in args]
|
||||
argnames = [arg.name for arg in args] + ["can_gc"]
|
||||
argnamesWithThis = ["s.get_context()", "thisValue.handle()"] + argnames
|
||||
argnamesWithoutThis = ["s.get_context()", "HandleValue::undefined()"] + argnames
|
||||
# Now that we've recorded the argnames for our call to our private
|
||||
|
@ -7940,6 +7940,9 @@ class CGCallback(CGClass):
|
|||
args.append(Argument("ExceptionHandling", "aExceptionHandling",
|
||||
"ReportExceptions"))
|
||||
|
||||
args.append(Argument("CanGc", "can_gc"))
|
||||
method.args.append(Argument("CanGc", "can_gc"))
|
||||
|
||||
# And now insert our template argument.
|
||||
argsWithoutThis = list(args)
|
||||
args.insert(0, Argument("&T", "thisObj"))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue