Fix builds.
This commit is contained in:
parent
66af69aaff
commit
c93e94c7cd
@ -57,6 +57,8 @@ impl GlobalRuntimeState<'_> {
|
|||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
#[must_use]
|
#[must_use]
|
||||||
pub fn new(engine: &Engine) -> Self {
|
pub fn new(engine: &Engine) -> Self {
|
||||||
|
let _engine = engine;
|
||||||
|
|
||||||
Self {
|
Self {
|
||||||
keys: StaticVec::new_const(),
|
keys: StaticVec::new_const(),
|
||||||
modules: StaticVec::new_const(),
|
modules: StaticVec::new_const(),
|
||||||
@ -71,7 +73,7 @@ impl GlobalRuntimeState<'_> {
|
|||||||
#[cfg(not(feature = "no_function"))]
|
#[cfg(not(feature = "no_function"))]
|
||||||
constants: std::collections::BTreeMap::new().into(),
|
constants: std::collections::BTreeMap::new().into(),
|
||||||
#[cfg(feature = "debugging")]
|
#[cfg(feature = "debugging")]
|
||||||
debugger: crate::eval::Debugger::new(engine),
|
debugger: crate::eval::Debugger::new(_engine),
|
||||||
dummy: PhantomData::default(),
|
dummy: PhantomData::default(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1685,6 +1685,8 @@ impl Module {
|
|||||||
// Save global state
|
// Save global state
|
||||||
let orig_imports_len = global.num_imports();
|
let orig_imports_len = global.num_imports();
|
||||||
let orig_source = global.source.clone();
|
let orig_source = global.source.clone();
|
||||||
|
#[cfg(not(feature = "no_module"))]
|
||||||
|
#[cfg(not(feature = "no_function"))]
|
||||||
let orig_constants = std::mem::take(&mut global.constants);
|
let orig_constants = std::mem::take(&mut global.constants);
|
||||||
|
|
||||||
// Run the script
|
// Run the script
|
||||||
@ -1717,7 +1719,11 @@ impl Module {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Restore global state
|
// Restore global state
|
||||||
|
#[cfg(not(feature = "no_module"))]
|
||||||
|
#[cfg(not(feature = "no_function"))]
|
||||||
|
{
|
||||||
global.constants = orig_constants;
|
global.constants = orig_constants;
|
||||||
|
}
|
||||||
global.truncate_imports(orig_imports_len);
|
global.truncate_imports(orig_imports_len);
|
||||||
global.source = orig_source;
|
global.source = orig_source;
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@ use crate::api::custom_syntax::{markers::*, CustomSyntax};
|
|||||||
use crate::api::options::LanguageOptions;
|
use crate::api::options::LanguageOptions;
|
||||||
use crate::ast::{
|
use crate::ast::{
|
||||||
BinaryExpr, ConditionalStmtBlock, CustomExpr, Expr, FnCallExpr, FnCallHashes, Ident,
|
BinaryExpr, ConditionalStmtBlock, CustomExpr, Expr, FnCallExpr, FnCallHashes, Ident,
|
||||||
OpAssignment, ScriptFnDef, Stmt, StmtBlock, SwitchCases, TryCatchBlock, AST_OPTION_FLAGS::*,
|
OpAssignment, ScriptFnDef, Stmt, SwitchCases, TryCatchBlock, AST_OPTION_FLAGS::*,
|
||||||
};
|
};
|
||||||
use crate::engine::{Precedence, KEYWORD_THIS, OP_CONTAINS};
|
use crate::engine::{Precedence, KEYWORD_THIS, OP_CONTAINS};
|
||||||
use crate::func::hashing::get_hasher;
|
use crate::func::hashing::get_hasher;
|
||||||
@ -3184,7 +3184,7 @@ fn make_curry_from_externals(
|
|||||||
let mut statements = StaticVec::with_capacity(externals.len() + 1);
|
let mut statements = StaticVec::with_capacity(externals.len() + 1);
|
||||||
statements.extend(externals.into_iter().map(Stmt::Share));
|
statements.extend(externals.into_iter().map(Stmt::Share));
|
||||||
statements.push(Stmt::Expr(expr));
|
statements.push(Stmt::Expr(expr));
|
||||||
Expr::Stmt(StmtBlock::new(statements, pos).into())
|
Expr::Stmt(crate::ast::StmtBlock::new(statements, pos).into())
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Parse an anonymous function definition.
|
/// Parse an anonymous function definition.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user