List.get with negative index in repl

This commit is contained in:
Folkert 2024-01-28 22:19:30 +01:00
parent 917e0e2027
commit b0d57587e3
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C
8 changed files with 109 additions and 33 deletions

View file

@ -160,7 +160,7 @@ impl<'a> ReplApp<'a> for WasmReplApp<'a> {
_main_fn_name: &str,
_ret_bytes: usize,
mut transform: F,
) -> T
) -> Option<T>
where
F: FnMut(&'a Self::Memory, usize) -> T,
Self::Memory: 'a,
@ -172,7 +172,7 @@ impl<'a> ReplApp<'a> for WasmReplApp<'a> {
let app_result_addr = js_get_result_and_memory(copied_bytes.as_mut_ptr());
let mem = self.arena.alloc(WasmMemory { copied_bytes });
transform(mem, app_result_addr)
Some(transform(mem, app_result_addr))
}
}