Allow multiple exports.

This commit is contained in:
Stephen Chung
2020-11-09 14:38:33 +08:00
parent 173f8474d6
commit 821e64adc4
8 changed files with 43 additions and 38 deletions

View File

@@ -2124,7 +2124,7 @@ impl Engine {
#[cfg(not(feature = "no_module"))]
if let Some(alias) = _alias {
scope.set_entry_alias(scope.len() - 1, alias);
scope.add_entry_alias(scope.len() - 1, alias);
}
Ok(Default::default())
}
@@ -2178,7 +2178,7 @@ impl Engine {
// Mark scope variables as public
if let Some(index) = scope.get_index(name).map(|(i, _)| i) {
let alias = rename.as_ref().map(|x| &x.name).unwrap_or_else(|| name);
scope.set_entry_alias(index, alias.clone());
scope.add_entry_alias(index, alias.clone());
} else {
return EvalAltResult::ErrorVariableNotFound(name.into(), *id_pos).into();
}