Remove fields and parameters under no_function.

This commit is contained in:
Stephen Chung
2021-11-29 09:43:35 +08:00
parent a3e79c0bd0
commit 95dc2ad502
14 changed files with 191 additions and 105 deletions

View File

@@ -86,12 +86,16 @@ impl Engine {
})
.collect();
#[cfg(feature = "no_function")]
let lib = crate::StaticVec::new_const();
let statements = std::mem::take(ast.statements_mut());
crate::optimizer::optimize_into_ast(self, scope, statements, lib, optimization_level)
crate::optimizer::optimize_into_ast(
self,
scope,
statements,
#[cfg(not(feature = "no_function"))]
lib,
optimization_level,
)
}
}