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

Method stringKeys

array_sparse.go:258–273  ·  view source on GitHub ↗
(all bool, accum []Value)

Source from the content-addressed store, hash-verified

256}
257
258func (a *sparseArrayObject) stringKeys(all bool, accum []Value) []Value {
259 if all {
260 for _, item := range a.items {
261 accum = append(accum, asciiString(strconv.FormatUint(uint64(item.idx), 10)))
262 }
263 } else {
264 for _, item := range a.items {
265 if prop, ok := item.value.(*valueProperty); ok && !prop.enumerable {
266 continue
267 }
268 accum = append(accum, asciiString(strconv.FormatUint(uint64(item.idx), 10)))
269 }
270 }
271
272 return a.baseObject.stringKeys(all, accum)
273}
274
275func (a *sparseArrayObject) setValues(values []Value, objCount int) {
276 a.items = make([]sparseArrayItem, 0, objCount)

Callers

nothing calls this directly

Calls 2

asciiStringTypeAlias · 0.85
stringKeysMethod · 0.65

Tested by

no test coverage detected