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

Method Set

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

Source from the content-addressed store, hash-verified

67}
68
69func (t *testDynArray) Set(idx int, val Value) bool {
70 if idx < 0 {
71 idx += len(t.a)
72 }
73 if idx < 0 {
74 return false
75 }
76 if idx >= len(t.a) {
77 t.expand(idx + 1)
78 }
79 t.a[idx] = val
80 return true
81}
82
83func (t *testDynArray) SetLen(i int) bool {
84 if i > len(t.a) {

Callers

nothing calls this directly

Calls 1

expandMethod · 0.95

Tested by

no test coverage detected