mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-06-16 22:41:24 +00:00
Add a flag to remove the wasm name section
This commit adds a `--remove-name-section` flag to the `wasm-bindgen` command which will remove the `name` section of the wasm file, used to indicate the names of functions typically used in debugging. This flag is off-by-default and will primarily be controlled by wasm-pack, typically being passed by default with `wasm-pack build --release`. Closes #1021
This commit is contained in:
@ -35,6 +35,7 @@ pub struct Bindgen {
|
||||
typescript: bool,
|
||||
demangle: bool,
|
||||
keep_debug: bool,
|
||||
remove_name_section: bool,
|
||||
// Experimental support for `WeakRefGroup`, an upcoming ECMAScript feature.
|
||||
// Currently only enable-able through an env var.
|
||||
weak_refs: bool,
|
||||
@ -62,6 +63,7 @@ impl Bindgen {
|
||||
typescript: false,
|
||||
demangle: true,
|
||||
keep_debug: false,
|
||||
remove_name_section: false,
|
||||
weak_refs: env::var("WASM_BINDGEN_WEAKREF").is_ok(),
|
||||
threads: threads_config(),
|
||||
}
|
||||
@ -124,6 +126,11 @@ impl Bindgen {
|
||||
self
|
||||
}
|
||||
|
||||
pub fn remove_name_section(&mut self, remove: bool) -> &mut Bindgen {
|
||||
self.remove_name_section = remove;
|
||||
self
|
||||
}
|
||||
|
||||
pub fn generate<P: AsRef<Path>>(&mut self, path: P) -> Result<(), Error> {
|
||||
self._generate(path.as_ref())
|
||||
}
|
||||
|
Reference in New Issue
Block a user