Encapsulate environment in ScriptFnDef.

This commit is contained in:
Stephen Chung
2020-10-13 09:38:14 +08:00
parent 0b4129fb98
commit 3c7805d514
5 changed files with 35 additions and 48 deletions

View File

@@ -823,6 +823,7 @@ pub fn optimize_into_ast(
#[cfg(not(feature = "no_closure"))]
externals: fn_def.externals.clone(),
pos: fn_def.pos,
lib: None,
}
.into()
})
@@ -862,7 +863,7 @@ pub fn optimize_into_ast(
});
} else {
_functions.into_iter().for_each(|fn_def| {
module.set_script_fn(fn_def);
module.set_script_fn(fn_def.into());
});
}