make wasm not require reinit

This commit is contained in:
2023-03-25 19:50:26 +00:00
parent 1e625a589a
commit a6c14b49a5
7 changed files with 250 additions and 29 deletions

View File

@@ -2,9 +2,12 @@ package main
import "fmt"
func makeGlobal() ArObject {
func makeGlobal(allowDocument bool) ArObject {
var vars = Map(anymap{})
vars.obj["global"] = vars
if allowDocument {
vars.obj["document"] = ArDocument
}
vars.obj["term"] = ArTerm
vars.obj["number"] = builtinFunc{"number", ArgonNumber}
vars.obj["string"] = builtinFunc{"string", ArgonString}