allow module environment to parse name section

This commit is contained in:
data-pup
2019-06-28 19:29:53 +00:00
committed by Benjamin Bouvier
parent 3293ca6b69
commit ac2ca6116b
5 changed files with 119 additions and 16 deletions

View File

@@ -468,6 +468,14 @@ pub trait ModuleEnvironment<'data> {
data: &'data [u8],
) -> WasmResult<()>;
/// Declares the name of a function to the environment.
///
/// By default this does nothing, but implementations can use this to read
/// the function name subsection of the custom name section if desired.
fn declare_func_name(&mut self, _func_index: FuncIndex, _name: &'data str) -> WasmResult<()> {
Ok(())
}
/// Indicates that a custom section has been found in the wasm file
fn custom_section(&mut self, name: &'data str, data: &'data [u8]) -> WasmResult<()> {
drop((name, data));