script_binding: wrapper of JSAutoStructuredCloneBuffer (#38284)

Instead of using raw pointer of JSAutoStructuredCloneBuffer, use its
wrapper JSAutoStructuredCloneBufferWrapper, which implements the Drop
trait that can prevent leakage when structured cloning fails.

Testing: Refactoring. Existing tests should be enough.
Fixes: #37966

---------

Signed-off-by: Kingsley Yung <kingsley@kkoyung.dev>
This commit is contained in:
Kingsley Yung 2025-07-27 20:41:02 +08:00 committed by GitHub
parent 633d746e2f
commit ab6e151c89
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 11 additions and 14 deletions

6
Cargo.lock generated
View file

@ -5228,7 +5228,7 @@ dependencies = [
[[package]]
name = "mozjs"
version = "0.14.1"
source = "git+https://github.com/servo/mozjs#128e1e230a0155ed9395c718184f34bddc045860"
source = "git+https://github.com/servo/mozjs#9c017973a4bf9186df2335d8c96ed3554b84434e"
dependencies = [
"bindgen 0.71.1",
"cc",
@ -5239,8 +5239,8 @@ dependencies = [
[[package]]
name = "mozjs_sys"
version = "0.128.13-0"
source = "git+https://github.com/servo/mozjs#128e1e230a0155ed9395c718184f34bddc045860"
version = "0.128.13-1"
source = "git+https://github.com/servo/mozjs#9c017973a4bf9186df2335d8c96ed3554b84434e"
dependencies = [
"bindgen 0.71.1",
"cc",