Don't hardcode string types.

This commit is contained in:
Josh Matthews 2021-05-14 17:13:17 -04:00 committed by GitHub
parent 5245f9ff27
commit 7439401ff8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1464,7 +1464,7 @@ unsafe extern "C" fn HostPopulateImportMeta(
rooted!(in(cx) let url_string = JS_NewStringCopyN(
cx,
base_url.as_str().as_ptr() as *const i8,
base_url.as_str().as_ptr() as *const _,
base_url.as_str().len()
));
@ -1472,7 +1472,7 @@ unsafe extern "C" fn HostPopulateImportMeta(
JS_DefineProperty4(
cx,
meta_object,
"url\0".as_ptr() as *const i8,
"url\0".as_ptr() as *const _,
url_string.handle().into_handle(),
JSPROP_ENUMERATE.into(),
)