From f119757f6a883c164c3646bf067d9e58fd6c311a Mon Sep 17 00:00:00 2001 From: Richard Ore Date: Sat, 26 Oct 2024 23:18:46 +0100 Subject: [PATCH] Fixed discarded locals on raise Exception --- libs/markdown/ruler.b | 2 +- libs/template/index.b | 2 +- libs/thread.b | 2 +- src/compiler.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libs/markdown/ruler.b b/libs/markdown/ruler.b index f074f75f..6a3e2473 100644 --- a/libs/markdown/ruler.b +++ b/libs/markdown/ruler.b @@ -240,7 +240,7 @@ class Ruler { if idx < 0 { if ignore_invalid return - raise Exception('Rules manager: invalid rule name ' + name); + raise Exception('Rules manager: invalid rule name ' + name) } self.__rules__[idx].enabled = true result.append(name) diff --git a/libs/template/index.b b/libs/template/index.b index 3a03aeb7..42703b43 100644 --- a/libs/template/index.b +++ b/libs/template/index.b @@ -570,7 +570,7 @@ class Template { # error('could not resolve "${_vars[0]}"') # Instead of returning an error, we'll return an empty string. This allows us to test - # for falsey, allows us to catch non-existing variables without an Exception and still + # for false, allows us to catch non-existing variables without an Exception and still # allow modifiers to be used with the non existing value. # # E.g. x-if="nonexistingvar|length" should still be false. diff --git a/libs/thread.b b/libs/thread.b index b91abdcd..d38a53de 100644 --- a/libs/thread.b +++ b/libs/thread.b @@ -78,7 +78,7 @@ * > * > When a thread's delegate function accepts parameters, it will always * > be given the thread instance itself as the first argument. Any other - * > argument passed into the function will be received in the postceeding + * > argument passed into the function will be received in the succeeding * > parameters. * * ### Awaiting a thread diff --git a/src/compiler.c b/src/compiler.c index 6cf0fa72..286f9d5f 100644 --- a/src/compiler.c +++ b/src/compiler.c @@ -2023,7 +2023,7 @@ static void echo_statement(b_parser *p) { } static void raise_statement(b_parser *p) { - discard_locals(p, p->vm->compiler->scope_depth); +// discard_locals(p, p->vm->compiler->scope_depth - 1); expression(p); emit_byte(p, OP_RAISE); consume_statement_end(p);