script: Use the new C string literal in the DOM bindings (#32741)

* simple conversion to cstrings using as_ptr()

Signed-off-by: Bum Kim <bumcrystlbum@gmail.com>

* replaced byte strings with c strings using new helper functions

Signed-off-by: Bum Kim <bumcrystlbum@gmail.com>

* changed &[u8] type parameters to &CStr

Signed-off-by: Bum Kim <bumcrystlbum@gmail.com>

---------

Signed-off-by: Bum Kim <bumcrystlbum@gmail.com>
This commit is contained in:
Bumsoo Kim 2024-07-11 00:18:54 -04:00 committed by GitHub
parent 3e163bfcdb
commit c6cb7ee981
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 60 additions and 63 deletions

View file

@ -732,7 +732,7 @@ impl WindowMethods for Window {
assert!(JS_DefineProperty(
*cx,
obj,
"opener\0".as_ptr() as *const libc::c_char,
c"opener".as_ptr(),
value,
JSPROP_ENUMERATE as u32
));