summaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
authorbluebear94 <uruwi@protonmail.com>2023-08-21 10:21:37 -0400
committerGitHub <noreply@github.com>2023-08-21 16:21:37 +0200
commit877df549aae877cf53de2fe250a552358fa5aad9 (patch)
tree26a6105ab61c418afdbbbfe34ab99d0837a5ddfb /crates
parent5c6434d4cef8bd1bf3ad2c77f379a8b174939ab9 (diff)
Check for control flow event before let binding (#1912)
Fixes #1906 (trying to destructure the result of `continue`).
Diffstat (limited to 'crates')
-rw-r--r--crates/typst/src/eval/mod.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/crates/typst/src/eval/mod.rs b/crates/typst/src/eval/mod.rs
index 88302c4a..f3da4263 100644
--- a/crates/typst/src/eval/mod.rs
+++ b/crates/typst/src/eval/mod.rs
@@ -1470,6 +1470,9 @@ impl Eval for ast::LetBinding<'_> {
Some(expr) => expr.eval(vm)?,
None => Value::None,
};
+ if vm.flow.is_some() {
+ return Ok(Value::None);
+ }
match self.kind() {
ast::LetBindingKind::Normal(pattern) => define_pattern(vm, pattern, value),