global_get_set

This commit is contained in:
Svyatoslav Nikolsky
2017-05-03 11:06:26 +03:00
parent 1498ce1ec1
commit cc3abac681
6 changed files with 107 additions and 40 deletions

View File

@ -299,6 +299,12 @@ impl<F> ModuleBuilder<F> where F: Invoke<elements::Module> {
import::ImportBuilder::with_callback(self)
}
/// With global variable
pub fn with_global(mut self, global: elements::GlobalEntry) -> Self {
self.module.global.entries_mut().push(global);
self
}
/// Build module (final step)
pub fn build(self) -> F::Result {
self.callback.invoke(self.module.into())