MCPcopy Create free account
hub / github.com/devld/go-drive / NewVM

Function NewVM

script/runtime.go:27–42  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

25}
26
27func NewVM() (*VM, error) {
28 ovm := otto.New()
29 ovm.Interrupt = make(chan func(), 1)
30 vm := &VM{
31 o: ovm,
32 vms: make(map[*otto.Otto]*VM),
33 vmsMu: &sync.RWMutex{},
34 disposables: make(map[any]struct{}),
35 }
36
37 if e := vm.init(); e != nil {
38 return nil, e
39 }
40
41 return vm, nil
42}
43
44func (v *VM) init() error {
45 initVarsForVm(v)

Callers 1

newPoolTestVMFunction · 0.85

Calls 1

initMethod · 0.95

Tested by 1

newPoolTestVMFunction · 0.68