Skip to content

Commit

Permalink
Support del on function attributes, since we support get and set
Browse files Browse the repository at this point in the history
  • Loading branch information
klange committed Jul 29, 2022
1 parent a0d66aa commit b5ab2bd
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/vm.c
Original file line number Diff line number Diff line change
Expand Up @@ -2499,8 +2499,15 @@ static int valueDelProperty(KrkString * name) {
}
krk_pop(); /* the original value */
return 1;
} else if (IS_CLOSURE(krk_peek(0))) {
KrkClosure * closure = AS_CLOSURE(krk_peek(0));
if (!krk_tableDelete(&closure->fields, OBJECT_VAL(name))) {
return 0;
}
krk_pop();
return 1;
}
/* TODO del on values? */
/* TODO __delattr__? Descriptor __delete__ methods? */
return 0;
}

Expand Down

0 comments on commit b5ab2bd

Please sign in to comment.