mirror of
https://github.com/servo/servo.git
synced 2025-09-27 23:30:08 +01:00
script: Make root_from_handle_value
a safe function by accepting SafeJSContext
(#39193)
Change from unsafe pointer of root_from_handle_value to SafeJSContext. #39131 --------- Signed-off-by: JasonHonKL <j2004nol@gmail.com> Signed-off-by: Jason <jason@198-61-252-113-on-nets.com> Signed-off-by: Josh Matthews <josh@joshmatthews.net> Co-authored-by: Jason <jason@198-61-252-113-on-nets.com> Co-authored-by: Josh Matthews <josh@joshmatthews.net>
This commit is contained in:
parent
721fc01c30
commit
839878c743
4 changed files with 48 additions and 51 deletions
|
@ -981,7 +981,7 @@ def getJSToNativeConversionInfo(type: IDLType, descriptorProvider: DescriptorPro
|
|||
|
||||
templateBody = fill(
|
||||
"""
|
||||
match ${function}($${val}, *cx) {
|
||||
match ${function}($${val}, cx) {
|
||||
Ok(val) => val,
|
||||
Err(()) => {
|
||||
$*{failureCode}
|
||||
|
@ -991,6 +991,7 @@ def getJSToNativeConversionInfo(type: IDLType, descriptorProvider: DescriptorPro
|
|||
failureCode=unwrapFailureCode + "\n",
|
||||
function=conversionFunction)
|
||||
|
||||
|
||||
declType = CGGeneric(descriptorType)
|
||||
if type.nullable():
|
||||
templateBody = f"Some({templateBody})"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue