Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions src/gfunction/misc/jj.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,12 @@ func Load_jj() {
ParamSlots: 0,
GFunction: jjGetProgramName,
}

ghelpers.MethodSignatures["jj._panic()V"] =
ghelpers.GMeth{
ParamSlots: 0,
GFunction: jjPanic,
}
}

func jjStringifyScalar(ftype string, fvalue any) *object.Object {
Expand Down Expand Up @@ -376,3 +382,11 @@ func jjGetProgramName([]interface{}) interface{} {
str := glob.JacobinName
return object.StringObjectFromGoString(str)
}

func jjPanic([]interface{}) interface{} {
trace.Warning("jjPanic: Will cause a Go runtime divide by zero panic")
var zero = 0
zero = 1 / zero
errMsg := "jjPanic: What??? No splash???"
return ghelpers.GetGErrBlk(excNames.VirtualMachineError, errMsg)
}
Loading