add test.ts

This commit is contained in:
2020-05-30 22:03:18 +08:00
parent 5cb322fabd
commit 5657303e97
3 changed files with 32 additions and 0 deletions

View File

@@ -0,0 +1 @@
cargo build --target wasm32-unknown-unknown

View File

@@ -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();