mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
ConstructorEnabled now takes a SafeJSContext instead of a JSContext
a first argument. The function cannot be made safe because of call to unsafe function is_exposed_in.
This commit is contained in:
parent
dbcd8d7af2
commit
cd0eb88a3e
1 changed files with 3 additions and 2 deletions
|
@ -2586,7 +2586,7 @@ class CGConstructorEnabled(CGAbstractMethod):
|
||||||
def __init__(self, descriptor):
|
def __init__(self, descriptor):
|
||||||
CGAbstractMethod.__init__(self, descriptor,
|
CGAbstractMethod.__init__(self, descriptor,
|
||||||
'ConstructorEnabled', 'bool',
|
'ConstructorEnabled', 'bool',
|
||||||
[Argument("*mut JSContext", "aCx"),
|
[Argument("SafeJSContext", "aCx"),
|
||||||
Argument("HandleObject", "aObj")],
|
Argument("HandleObject", "aObj")],
|
||||||
unsafe=True)
|
unsafe=True)
|
||||||
|
|
||||||
|
@ -3285,7 +3285,7 @@ class CGDefineDOMInterfaceMethod(CGAbstractMethod):
|
||||||
return CGGeneric("""\
|
return CGGeneric("""\
|
||||||
assert!(!global.get().is_null());
|
assert!(!global.get().is_null());
|
||||||
|
|
||||||
if !ConstructorEnabled(cx, global) {
|
if !ConstructorEnabled(SafeJSContext::from_ptr(cx), global) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6006,6 +6006,7 @@ def generate_imports(config, cgthings, descriptors, callbacks=None, dictionaries
|
||||||
'crate::mem::malloc_size_of_including_raw_self',
|
'crate::mem::malloc_size_of_including_raw_self',
|
||||||
'crate::compartments::InCompartment',
|
'crate::compartments::InCompartment',
|
||||||
'crate::compartments::AlreadyInCompartment',
|
'crate::compartments::AlreadyInCompartment',
|
||||||
|
'crate::script_runtime::JSContext as SafeJSContext',
|
||||||
'libc',
|
'libc',
|
||||||
'servo_config::pref',
|
'servo_config::pref',
|
||||||
'servo_config::prefs',
|
'servo_config::prefs',
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue