Auto merge of #28416 - servo:jdm-patch-49, r=jdm

Don't hardcode string types.

Fixes an error reported in #28413.
This commit is contained in:
bors-servo 2021-05-14 18:53:07 -04:00 committed by GitHub
commit 56d12d8a86
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( rooted!(in(cx) let url_string = JS_NewStringCopyN(
cx, cx,
base_url.as_str().as_ptr() as *const i8, base_url.as_str().as_ptr() as *const _,
base_url.as_str().len() base_url.as_str().len()
)); ));
@ -1472,7 +1472,7 @@ unsafe extern "C" fn HostPopulateImportMeta(
JS_DefineProperty4( JS_DefineProperty4(
cx, cx,
meta_object, meta_object,
"url\0".as_ptr() as *const i8, "url\0".as_ptr() as *const _,
url_string.handle().into_handle(), url_string.handle().into_handle(),
JSPROP_ENUMERATE.into(), JSPROP_ENUMERATE.into(),
) )