interp: do not try to interpret past task.Pause()

For context, see:
https://github.com/tinygo-org/tinygo/pull/2863#issuecomment-1133875237

Basically, testdata/goroutine.go was doing `time.Sleep()` inside an init
function which broke because doing that from a non-goroutine is not
allowed. However, we never hit this bug because of
https://github.com/tinygo-org/tinygo/issues/2842 (I didn't investigate
exactly why).
Этот коммит содержится в:
Ayke van Laethem 2022-05-22 14:02:01 +02:00 коммит произвёл Ron Evans
родитель 4ed0936c0e
коммит dd1a836903

Просмотреть файл

@ -219,6 +219,9 @@ func (r *runner) run(fn *function, params []value, parentMem *memoryView, indent
if err != nil { if err != nil {
return nil, mem, err return nil, mem, err
} }
case callFn.name == "internal/task.Pause":
// Task scheduling isn't possible at compile time.
return nil, mem, r.errorAt(inst, errUnsupportedRuntimeInst)
case callFn.name == "runtime.nanotime" && r.pkgName == "time": case callFn.name == "runtime.nanotime" && r.pkgName == "time":
// The time package contains a call to runtime.nanotime. // The time package contains a call to runtime.nanotime.
// This appears to be to work around a limitation in Windows // This appears to be to work around a limitation in Windows