File tree Expand file tree Collapse file tree 1 file changed +3
-10
lines changed
Expand file tree Collapse file tree 1 file changed +3
-10
lines changed Original file line number Diff line number Diff line change @@ -2,29 +2,22 @@ package main
22
33import (
44 "encoding/json"
5- "fmt"
65 "syscall/js"
76
87 "github.com/aman/code-complexity-viz/analyzer"
98)
109
1110func main () {
1211 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 )
12+ js .Global ().Set ("analyzeGoCode" , js .FuncOf (analyzeGoCode ))
2013 <- c
2114}
2215
2316func analyzeGoCode (this js.Value , args []js.Value ) (result interface {}) {
2417 // Recover from panics
2518 defer func () {
2619 if r := recover (); r != nil {
27- result = wrap ("Internal error: " + fmt .Sprint (r ), nil )
20+ result = wrap ("Internal error: " + fmt .Sprint (r ), nil )
2821 }
2922 }()
3023
@@ -76,4 +69,4 @@ func wrap(err string, data interface{}) js.Value {
7669 result ["data" ] = data
7770 }
7871 return js .ValueOf (result )
79- }
72+ }
You can’t perform that action at this time.
0 commit comments