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

Method resolveVM

script/runtime.go:89–93  ·  view source on GitHub ↗

resolveVM returns the *VM that owns the given otto runtime. Forks share a single vms map, so reads must be guarded against concurrent Fork/Dispose writes happening on other VMs of the same family.

(o *otto.Otto)

Source from the content-addressed store, hash-verified

87// single vms map, so reads must be guarded against concurrent Fork/Dispose
88// writes happening on other VMs of the same family.
89func (v *VM) resolveVM(o *otto.Otto) *VM {
90 v.vmsMu.RLock()
91 defer v.vmsMu.RUnlock()
92 return v.vms[o]
93}
94
95// Run runs code with this VM. Run can NOT be executed concurrency
96func (v *VM) Run(ctx context.Context, code any) (*Value, error) {

Callers 1

WrapVmCallFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected