File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11//go:build wasm && js
22
3- // Modified version with of the builtins.go file with browser friendly functions.
3+ // Modified version with of the builtins.go file with browser friendly versions of functions.
44package evaluator
55
66import (
@@ -36,13 +36,6 @@ var builtins = map[string]*object.Builtin{
3636 result = jsPromptFunction .Invoke (args [0 ].Inspect ())
3737 }
3838
39- // fmt.Println("the arguments", args[0].Inspect())
40- // fmt.Println("the result of window.prompt", result.String())
41-
42- // buffer := bufio.NewReader(os.Stdin)
43-
44- // line, _, err := buffer.ReadLine()
45-
4639 if result .String () == "" || result .String () == "null" {
4740 return newError ("Nimeshindwa kusoma uliyo yajaza" )
4841 }
@@ -64,9 +57,7 @@ var builtins = map[string]*object.Builtin{
6457 arr = append (arr , arg .Inspect ())
6558 }
6659 str := strings .Join (arr , " " )
67- // fmt.Println(str) // removed Print to console
68- // return &object.String{Value: str} // return the output
69- jsOutputReceiverFunction .Invoke (str )
60+ jsOutputReceiverFunction .Invoke (str ) // pipe output to js land
7061 }
7162 return nil
7263 },
You can’t perform that action at this time.
0 commit comments