Skip to content

Commit

Permalink
Fixed discarded locals on raise Exception
Browse files Browse the repository at this point in the history
  • Loading branch information
mcfriend99 committed Oct 26, 2024
1 parent f5b4a1d commit f119757
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion libs/markdown/ruler.b
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion libs/template/index.b
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion libs/thread.b
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/compiler.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit f119757

Please sign in to comment.