2015-02-16 13:28:33 +00:00
|
|
|
package otto
|
|
|
|
|
|
|
|
import ()
|
|
|
|
|
|
|
|
type _resultKind int
|
|
|
|
|
|
|
|
const (
|
|
|
|
resultNormal _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 {
|
2015-03-20 12:22:01 +00:00
|
|
|
return _result{resultContinue, emptyValue, target}
|
2015-02-16 13:28:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func newBreakResult(target string) _result {
|
2015-03-20 12:22:01 +00:00
|
|
|
return _result{resultBreak, emptyValue, target}
|
2015-02-16 13:28:33 +00:00
|
|
|
}
|