github.com/HaHadaxigua/yaegi@v1.0.1/stdlib/go1_17_runtime.go (about)

     1  // Code generated by 'yaegi extract runtime'. DO NOT EDIT.
     2  
     3  //go:build go1.17
     4  // +build go1.17
     5  
     6  package stdlib
     7  
     8  import (
     9  	"go/constant"
    10  	"go/token"
    11  	"reflect"
    12  	"runtime"
    13  )
    14  
    15  func init() {
    16  	Symbols["runtime/runtime"] = map[string]reflect.Value{
    17  		// function, constant and variable definitions
    18  		"BlockProfile":            reflect.ValueOf(runtime.BlockProfile),
    19  		"Breakpoint":              reflect.ValueOf(runtime.Breakpoint),
    20  		"CPUProfile":              reflect.ValueOf(runtime.CPUProfile),
    21  		"Caller":                  reflect.ValueOf(runtime.Caller),
    22  		"Callers":                 reflect.ValueOf(runtime.Callers),
    23  		"CallersFrames":           reflect.ValueOf(runtime.CallersFrames),
    24  		"Compiler":                reflect.ValueOf(constant.MakeFromLiteral("\"gc\"", token.STRING, 0)),
    25  		"FuncForPC":               reflect.ValueOf(runtime.FuncForPC),
    26  		"GC":                      reflect.ValueOf(runtime.GC),
    27  		"GOARCH":                  reflect.ValueOf(runtime.GOARCH),
    28  		"GOMAXPROCS":              reflect.ValueOf(runtime.GOMAXPROCS),
    29  		"GOOS":                    reflect.ValueOf(runtime.GOOS),
    30  		"GOROOT":                  reflect.ValueOf(runtime.GOROOT),
    31  		"Goexit":                  reflect.ValueOf(runtime.Goexit),
    32  		"GoroutineProfile":        reflect.ValueOf(runtime.GoroutineProfile),
    33  		"Gosched":                 reflect.ValueOf(runtime.Gosched),
    34  		"KeepAlive":               reflect.ValueOf(runtime.KeepAlive),
    35  		"LockOSThread":            reflect.ValueOf(runtime.LockOSThread),
    36  		"MemProfile":              reflect.ValueOf(runtime.MemProfile),
    37  		"MemProfileRate":          reflect.ValueOf(&runtime.MemProfileRate).Elem(),
    38  		"MutexProfile":            reflect.ValueOf(runtime.MutexProfile),
    39  		"NumCPU":                  reflect.ValueOf(runtime.NumCPU),
    40  		"NumCgoCall":              reflect.ValueOf(runtime.NumCgoCall),
    41  		"NumGoroutine":            reflect.ValueOf(runtime.NumGoroutine),
    42  		"ReadMemStats":            reflect.ValueOf(runtime.ReadMemStats),
    43  		"ReadTrace":               reflect.ValueOf(runtime.ReadTrace),
    44  		"SetBlockProfileRate":     reflect.ValueOf(runtime.SetBlockProfileRate),
    45  		"SetCPUProfileRate":       reflect.ValueOf(runtime.SetCPUProfileRate),
    46  		"SetCgoTraceback":         reflect.ValueOf(runtime.SetCgoTraceback),
    47  		"SetFinalizer":            reflect.ValueOf(runtime.SetFinalizer),
    48  		"SetMutexProfileFraction": reflect.ValueOf(runtime.SetMutexProfileFraction),
    49  		"Stack":                   reflect.ValueOf(runtime.Stack),
    50  		"StartTrace":              reflect.ValueOf(runtime.StartTrace),
    51  		"StopTrace":               reflect.ValueOf(runtime.StopTrace),
    52  		"ThreadCreateProfile":     reflect.ValueOf(runtime.ThreadCreateProfile),
    53  		"UnlockOSThread":          reflect.ValueOf(runtime.UnlockOSThread),
    54  		"Version":                 reflect.ValueOf(runtime.Version),
    55  
    56  		// type definitions
    57  		"BlockProfileRecord": reflect.ValueOf((*runtime.BlockProfileRecord)(nil)),
    58  		"Error":              reflect.ValueOf((*runtime.Error)(nil)),
    59  		"Frame":              reflect.ValueOf((*runtime.Frame)(nil)),
    60  		"Frames":             reflect.ValueOf((*runtime.Frames)(nil)),
    61  		"Func":               reflect.ValueOf((*runtime.Func)(nil)),
    62  		"MemProfileRecord":   reflect.ValueOf((*runtime.MemProfileRecord)(nil)),
    63  		"MemStats":           reflect.ValueOf((*runtime.MemStats)(nil)),
    64  		"StackRecord":        reflect.ValueOf((*runtime.StackRecord)(nil)),
    65  		"TypeAssertionError": reflect.ValueOf((*runtime.TypeAssertionError)(nil)),
    66  
    67  		// interface wrapper definitions
    68  		"_Error": reflect.ValueOf((*_runtime_Error)(nil)),
    69  	}
    70  }
    71  
    72  // _runtime_Error is an interface wrapper for Error type
    73  type _runtime_Error struct {
    74  	IValue        interface{}
    75  	WError        func() string
    76  	WRuntimeError func()
    77  }
    78  
    79  func (W _runtime_Error) Error() string {
    80  	return W.WError()
    81  }
    82  func (W _runtime_Error) RuntimeError() {
    83  	W.WRuntimeError()
    84  }