[oden] JavaScript, god help me

This commit is contained in:
John Doty 2023-06-19 13:46:09 -07:00
parent 16e6f1304c
commit 8d7dd789ed
6 changed files with 92 additions and 4 deletions

View file

@ -50,6 +50,8 @@ extern "C" {
magic: ::std::os::raw::c_int,
) -> JSValue;
fn JS_MakeException_real() -> JSValue;
fn JS_MakeNull_real() -> JSValue;
fn JS_MakeUndefined_real() -> JSValue;
fn JS_ValueGetPtr_real(v: JSValue) -> *mut ::std::os::raw::c_void;
}
@ -218,6 +220,14 @@ pub unsafe fn JS_MakeException() -> JSValue {
JS_MakeException_real()
}
pub unsafe fn JS_MakeNull() -> JSValue {
JS_MakeNull_real()
}
pub unsafe fn JS_MakeUndefined() -> JSValue {
JS_MakeUndefined_real()
}
pub unsafe fn JS_ValueGetPtr(v: JSValue) -> *mut ::std::os::raw::c_void {
JS_ValueGetPtr_real(v)
}

View file

@ -129,6 +129,14 @@ JSValue JS_MakeException_real() {
return JS_EXCEPTION;
}
JSValue JS_MakeNull_real() {
return JS_NULL;
}
JSValue JS_MakeUndefined_real() {
return JS_UNDEFINED;
}
void *JS_ValueGetPtr_real(JSValue val) {
return JS_VALUE_GET_PTR(val);
}