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

Method Set

object_dynamic_test.go:355–369  ·  view source on GitHub ↗
(idx int, val Value)

Source from the content-addressed store, hash-verified

353}
354
355func (t *testSharedDynArray) Set(idx int, val Value) bool {
356 t.Lock()
357 defer t.Unlock()
358 if idx < 0 {
359 idx += len(t.a)
360 }
361 if idx < 0 {
362 return false
363 }
364 if idx >= len(t.a) {
365 t.expand(idx + 1)
366 }
367 t.a[idx] = val
368 return true
369}
370
371func (t *testSharedDynArray) SetLen(i int) bool {
372 t.Lock()

Callers

nothing calls this directly

Calls 1

expandMethod · 0.95

Tested by

no test coverage detected