Skip to content

Commit a884b3d

Browse files
authored
Use init func to help autodiscover (#130)
* Use init func to help autodiscover
1 parent 9a5deb7 commit a884b3d

113 files changed

Lines changed: 711 additions & 5 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

abortcontroller/abortcontroller.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,14 @@ import (
66

77
"github.com/realPy/hogosuru/abortsignal"
88
"github.com/realPy/hogosuru/baseobject"
9+
"github.com/realPy/hogosuru/initinterface"
910
)
1011

12+
func init() {
13+
14+
initinterface.RegisterInterface(GetInterface)
15+
}
16+
1117
var singleton sync.Once
1218

1319
var abortcontrollerinterface js.Value

abortsignal/abortsignal.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,14 @@ import (
66

77
"github.com/realPy/hogosuru/baseobject"
88
"github.com/realPy/hogosuru/eventtarget"
9+
"github.com/realPy/hogosuru/initinterface"
910
)
1011

12+
func init() {
13+
14+
initinterface.RegisterInterface(GetInterface)
15+
}
16+
1117
var singleton sync.Once
1218

1319
var abortsignalinterface js.Value

abortsignal/abortsignal_test.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,9 @@ package abortsignal
22

33
import (
44
"testing"
5-
6-
"github.com/realPy/hogosuru/baseobject"
75
)
86

97
func TestMain(m *testing.M) {
10-
baseobject.SetSyscall()
8+
119
m.Run()
1210
}

animationevent/animationevent.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,14 @@ import (
88

99
"github.com/realPy/hogosuru/baseobject"
1010
"github.com/realPy/hogosuru/event"
11+
"github.com/realPy/hogosuru/initinterface"
1112
)
1213

14+
func init() {
15+
16+
initinterface.RegisterInterface(GetInterface)
17+
}
18+
1319
var singleton sync.Once
1420

1521
var animationeventinterface js.Value

array/array.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,15 @@ import (
55
"syscall/js"
66

77
"github.com/realPy/hogosuru/baseobject"
8+
"github.com/realPy/hogosuru/initinterface"
89
"github.com/realPy/hogosuru/iterator"
910
)
1011

12+
func init() {
13+
14+
initinterface.RegisterInterface(GetInterface)
15+
}
16+
1117
var singleton sync.Once
1218

1319
var arrayinterface js.Value

arraybuffer/arraybuffer.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,14 @@ import (
99
"syscall/js"
1010

1111
"github.com/realPy/hogosuru/baseobject"
12+
"github.com/realPy/hogosuru/initinterface"
1213
)
1314

15+
func init() {
16+
17+
initinterface.RegisterInterface(GetInterface)
18+
}
19+
1420
var singleton sync.Once
1521

1622
var arraybufferinterface js.Value

attr/attr.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,15 @@ import (
55
"syscall/js"
66

77
"github.com/realPy/hogosuru/baseobject"
8+
"github.com/realPy/hogosuru/initinterface"
89
"github.com/realPy/hogosuru/node"
910
)
1011

12+
func init() {
13+
14+
initinterface.RegisterInterface(GetInterface)
15+
}
16+
1117
var singleton sync.Once
1218

1319
var attrinterface js.Value

blob/blob.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,17 @@ import (
1010

1111
"github.com/realPy/hogosuru/arraybuffer"
1212
"github.com/realPy/hogosuru/baseobject"
13+
"github.com/realPy/hogosuru/initinterface"
1314
"github.com/realPy/hogosuru/promise"
1415
"github.com/realPy/hogosuru/stream"
1516
readablestream "github.com/realPy/hogosuru/stream"
1617
)
1718

19+
func init() {
20+
21+
initinterface.RegisterInterface(GetInterface)
22+
}
23+
1824
var singleton sync.Once
1925

2026
var blobinterface js.Value

broadcastchannel/broadcastchannel.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,15 @@ import (
1010

1111
"github.com/realPy/hogosuru/baseobject"
1212
"github.com/realPy/hogosuru/eventtarget"
13+
"github.com/realPy/hogosuru/initinterface"
1314
"github.com/realPy/hogosuru/messageevent"
1415
)
1516

17+
func init() {
18+
19+
initinterface.RegisterInterface(GetInterface)
20+
}
21+
1622
var singleton sync.Once
1723

1824
var bcinterface js.Value

console/console.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,14 @@ import (
55
"syscall/js"
66

77
"github.com/realPy/hogosuru/baseobject"
8+
"github.com/realPy/hogosuru/initinterface"
89
)
910

11+
func init() {
12+
13+
initinterface.RegisterInterface(GetInterface)
14+
}
15+
1016
var singleton sync.Once
1117

1218
var consoleinterface js.Value

0 commit comments

Comments
 (0)