MCPcopy Create free account
hub / github.com/dop251/goja / Get

Method Get

object_dynamic_test.go:333–343  ·  view source on GitHub ↗
(idx int)

Source from the content-addressed store, hash-verified

331}
332
333func (t *testSharedDynArray) Get(idx int) Value {
334 t.RLock()
335 defer t.RUnlock()
336 if idx < 0 {
337 idx += len(t.a)
338 }
339 if idx >= 0 && idx < len(t.a) {
340 return t.a[idx]
341 }
342 return nil
343}
344
345func (t *testSharedDynArray) expand(newLen int) {
346 if newLen > cap(t.a) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected