server
Some checks failed
Build / build (push) Failing after 6m4s
Test / build (push) Failing after 6m33s

This commit is contained in:
Chuck Smith
2024-04-02 12:21:41 -04:00
parent 862119e90e
commit 4c9ec5aaaa
77 changed files with 1181 additions and 244 deletions

View File

@@ -1,12 +1,13 @@
package builtins
import (
"monkey/internal/context"
"monkey/internal/object"
"monkey/internal/typing"
)
// Exit ...
func Exit(args ...object.Object) object.Object {
func Exit(ctx context.Context, args ...object.Object) object.Object {
if err := typing.Check(
"exit", args,
typing.RangeOfArgs(0, 1),
@@ -20,7 +21,7 @@ func Exit(args ...object.Object) object.Object {
status = int(args[0].(object.Integer).Value)
}
object.ExitFunction(status)
ctx.Exit(status)
return nil
}