add test.ts
This commit is contained in:
1
deno_test_wasm/test_wasm/build.sh
Normal file
1
deno_test_wasm/test_wasm/build.sh
Normal file
@@ -0,0 +1 @@
|
||||
cargo build --target wasm32-unknown-unknown
|
||||
@@ -7,6 +7,7 @@ pub extern "C" fn malloc(len: usize) -> *mut c_char {
|
||||
s.into_raw()
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn to_uppercase(ptr: *mut c_char) -> *mut c_char {
|
||||
let s = unsafe { CString::from_raw(ptr) };
|
||||
let s2 = CString::new(s.to_string_lossy().to_uppercase()).unwrap();
|
||||
|
||||
Reference in New Issue
Block a user