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:
JasonHonKL 2025-09-09 12:26:02 -07:00 committed by GitHub
parent 721fc01c30
commit 839878c743
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 48 additions and 51 deletions

View file

@ -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})"