/
go120_export.go
executable file
·57 lines (51 loc) · 2.02 KB
/
go120_export.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
// export by github.com/goplus/igop/cmd/qexp
//go:build go1.20 && js
// +build go1.20,js
package js
import (
q "syscall/js"
"go/constant"
"reflect"
"github.com/goplus/igop"
)
func init() {
igop.RegisterPackage(&igop.Package{
Name: "js",
Path: "syscall/js",
Deps: map[string]string{
"runtime": "runtime",
"sync": "sync",
"unsafe": "unsafe",
},
Interfaces: map[string]reflect.Type{},
NamedTypes: map[string]reflect.Type{
"Error": reflect.TypeOf((*q.Error)(nil)).Elem(),
"Func": reflect.TypeOf((*q.Func)(nil)).Elem(),
"Type": reflect.TypeOf((*q.Type)(nil)).Elem(),
"Value": reflect.TypeOf((*q.Value)(nil)).Elem(),
"ValueError": reflect.TypeOf((*q.ValueError)(nil)).Elem(),
},
AliasTypes: map[string]reflect.Type{},
Vars: map[string]reflect.Value{},
Funcs: map[string]reflect.Value{
"CopyBytesToGo": reflect.ValueOf(q.CopyBytesToGo),
"CopyBytesToJS": reflect.ValueOf(q.CopyBytesToJS),
"FuncOf": reflect.ValueOf(q.FuncOf),
"Global": reflect.ValueOf(q.Global),
"Null": reflect.ValueOf(q.Null),
"Undefined": reflect.ValueOf(q.Undefined),
"ValueOf": reflect.ValueOf(q.ValueOf),
},
TypedConsts: map[string]igop.TypedConst{
"TypeBoolean": {reflect.TypeOf(q.TypeBoolean), constant.MakeInt64(int64(q.TypeBoolean))},
"TypeFunction": {reflect.TypeOf(q.TypeFunction), constant.MakeInt64(int64(q.TypeFunction))},
"TypeNull": {reflect.TypeOf(q.TypeNull), constant.MakeInt64(int64(q.TypeNull))},
"TypeNumber": {reflect.TypeOf(q.TypeNumber), constant.MakeInt64(int64(q.TypeNumber))},
"TypeObject": {reflect.TypeOf(q.TypeObject), constant.MakeInt64(int64(q.TypeObject))},
"TypeString": {reflect.TypeOf(q.TypeString), constant.MakeInt64(int64(q.TypeString))},
"TypeSymbol": {reflect.TypeOf(q.TypeSymbol), constant.MakeInt64(int64(q.TypeSymbol))},
"TypeUndefined": {reflect.TypeOf(q.TypeUndefined), constant.MakeInt64(int64(q.TypeUndefined))},
},
UntypedConsts: map[string]igop.UntypedConst{},
})
}