mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Make DefineDOMInterface and ConstructorEnabled unsafe functions.
This commit is contained in:
parent
e99054f731
commit
28630f5487
1 changed files with 6 additions and 4 deletions
|
@ -2241,7 +2241,8 @@ class CGConstructorEnabled(CGAbstractMethod):
|
||||||
CGAbstractMethod.__init__(self, descriptor,
|
CGAbstractMethod.__init__(self, descriptor,
|
||||||
'ConstructorEnabled', 'bool',
|
'ConstructorEnabled', 'bool',
|
||||||
[Argument("*mut JSContext", "aCx"),
|
[Argument("*mut JSContext", "aCx"),
|
||||||
Argument("HandleObject", "aObj")])
|
Argument("HandleObject", "aObj")],
|
||||||
|
unsafe_fn=True)
|
||||||
|
|
||||||
def definition_body(self):
|
def definition_body(self):
|
||||||
body = CGList([], "\n")
|
body = CGList([], "\n")
|
||||||
|
@ -2809,7 +2810,8 @@ class CGDefineDOMInterfaceMethod(CGAbstractMethod):
|
||||||
Argument('*mut JSContext', 'cx'),
|
Argument('*mut JSContext', 'cx'),
|
||||||
Argument('HandleObject', 'global'),
|
Argument('HandleObject', 'global'),
|
||||||
]
|
]
|
||||||
CGAbstractMethod.__init__(self, descriptor, 'DefineDOMInterface', 'void', args, pub=True)
|
CGAbstractMethod.__init__(self, descriptor, 'DefineDOMInterface',
|
||||||
|
'void', args, pub=True, unsafe_fn=True)
|
||||||
|
|
||||||
def define(self):
|
def define(self):
|
||||||
return CGAbstractMethod.define(self)
|
return CGAbstractMethod.define(self)
|
||||||
|
@ -6250,10 +6252,10 @@ class GlobalGenRoots():
|
||||||
pairs.append((ctor.identifier.name, binding))
|
pairs.append((ctor.identifier.name, binding))
|
||||||
pairs.sort(key=operator.itemgetter(0))
|
pairs.sort(key=operator.itemgetter(0))
|
||||||
mappings = [
|
mappings = [
|
||||||
CGGeneric('b"%s" => codegen::Bindings::%s::DefineDOMInterface as fn(_, _),' % pair)
|
CGGeneric('b"%s" => codegen::Bindings::%s::DefineDOMInterface as unsafe fn(_, _),' % pair)
|
||||||
for pair in pairs
|
for pair in pairs
|
||||||
]
|
]
|
||||||
mapType = "phf::Map<&'static [u8], fn(*mut JSContext, HandleObject)>"
|
mapType = "phf::Map<&'static [u8], unsafe fn(*mut JSContext, HandleObject)>"
|
||||||
phf = CGWrapper(
|
phf = CGWrapper(
|
||||||
CGIndenter(CGList(mappings, "\n")),
|
CGIndenter(CGList(mappings, "\n")),
|
||||||
pre="pub static MAP: %s = phf_map! {\n" % mapType,
|
pre="pub static MAP: %s = phf_map! {\n" % mapType,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue