Do not search for global functions if scripted.

This commit is contained in:
Stephen Chung
2022-09-21 18:30:12 +08:00
parent 5d275b5307
commit 6eef11123a
5 changed files with 28 additions and 28 deletions

View File

@@ -865,7 +865,7 @@ impl Engine {
#[cfg(not(feature = "no_module"))]
if global.scope_level == 0
&& access == AccessMode::ReadOnly
&& lib.iter().any(|&m| !m.is_empty())
&& lib.iter().copied().any(Module::is_empty)
{
crate::func::locked_write(global.constants.get_or_insert_with(
|| {