From 4ec9e76440828632484b369accdc42d9bdc0e54b Mon Sep 17 00:00:00 2001 From: Kirill Zabelin Date: Mon, 8 Sep 2025 14:37:46 +0200 Subject: [PATCH] Set input in with_document too when reuse engine (#474) --- src/interpreter.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/interpreter.rs b/src/interpreter.rs index 80f8b04..830424c 100644 --- a/src/interpreter.rs +++ b/src/interpreter.rs @@ -316,7 +316,11 @@ impl Interpreter { } pub fn set_input(&mut self, input: Value) { - self.input = input; + self.input = input.clone(); + // Update with_document["input"] too, in case if engine is being reused and was already prepared + if let Ok(with_input) = Self::make_or_get_value_mut(&mut self.with_document, &["input"]) { + *with_input = input; + } } pub fn init_with_document(&mut self) -> Result<()> {