File tree Expand file tree Collapse file tree 1 file changed +3
-9
lines changed
Expand file tree Collapse file tree 1 file changed +3
-9
lines changed Original file line number Diff line number Diff line change @@ -10,21 +10,15 @@ import (
1010
1111func main () {
1212 c := make (chan struct {}, 0 )
13- defer close (c )
14-
15- // Register function and ensure cleanup
16- analyzeFunc := js .FuncOf (analyzeGoCode )
17- defer analyzeFunc .Release ()
18-
19- js .Global ().Set ("analyzeGoCode" , analyzeFunc )
13+ js .Global ().Set ("analyzeGoCode" , js .FuncOf (analyzeGoCode ))
2014 <- c
2115}
2216
2317func analyzeGoCode (this js.Value , args []js.Value ) (result interface {}) {
2418 // Recover from panics
2519 defer func () {
2620 if r := recover (); r != nil {
27- result = wrap ("Internal error: " + fmt .Sprint (r ), nil )
21+ result = wrap ("Internal error: " + fmt .Sprint (r ), nil )
2822 }
2923 }()
3024
@@ -76,4 +70,4 @@ func wrap(err string, data interface{}) js.Value {
7670 result ["data" ] = data
7771 }
7872 return js .ValueOf (result )
79- }
73+ }
You can’t perform that action at this time.
0 commit comments