1
0
mirror of https://github.com/robertkrimen/otto synced 2025-10-05 19:19:10 +08:00
otto/result.go
Steven Hartland 026a1d9a9c
chore: lint and naming refactor (#475)
Enable more linters, address the issues and do a major naming refactor
to use golang lower camelCase identifiers for types, functions, methods
and variable names.

Also: 
* Clean up inline generation so it doesn't rely on temporary variables.
* Remove unused functions generated by inline.pl.
2022-12-04 21:49:38 +00:00

29 lines
463 B
Go

package otto
type resultKind int
const (
_ resultKind = iota
resultReturn
resultBreak
resultContinue
)
type result struct {
kind resultKind
value Value
target string
}
func newReturnResult(value Value) result {
return result{resultReturn, value, ""}
}
func newContinueResult(target string) result {
return result{resultContinue, emptyValue, target}
}
func newBreakResult(target string) result {
return result{resultBreak, emptyValue, target}
}