Skip to content

Commit 2e6bf72

Browse files
Make WARN error on empty call.
1 parent cb94896 commit 2e6bf72

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/builtins.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5818,6 +5818,9 @@ static Value builtin_print(Interpreter* interp, Value* args, int argc, Expr** ar
58185818
static Value builtin_warn(Interpreter* interp, Value* args, int argc, Expr** arg_nodes, Env* env, int line, int col) {
58195819
(void)arg_nodes; (void)env; (void)line; (void)col;
58205820
if (!interp) return value_bool(false);
5821+
if (argc < 1) {
5822+
RUNTIME_ERROR(interp, "WARN expects 1 argument", line, col);
5823+
}
58215824

58225825
int forward = (interp->verbose && !interp->shushed);
58235826

0 commit comments

Comments
 (0)