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

Method setOwnStr

object_template.go:425–436  ·  view source on GitHub ↗
(name unistring.String, value Value, throw bool)

Source from the content-addressed store, hash-verified

423}
424
425func (a *templatedArrayObject) setOwnStr(name unistring.String, value Value, throw bool) bool {
426 if name == "length" {
427 return a.setLength(a.val.runtime.toLengthUint32(value), throw)
428 }
429 if !a.templatedObject.setOwnStr(name, value, throw) {
430 return false
431 }
432 if idx := strToArrayIdx(name); idx != math.MaxUint32 {
433 a._setOwnIdx(idx)
434 }
435 return true
436}
437
438func (a *templatedArrayObject) setOwnIdx(p valueInt, v Value, throw bool) bool {
439 if !a.templatedObject.setOwnStr(p.string(), v, throw) {

Callers

nothing calls this directly

Calls 5

setLengthMethod · 0.95
_setOwnIdxMethod · 0.95
strToArrayIdxFunction · 0.85
toLengthUint32Method · 0.80
setOwnStrMethod · 0.65

Tested by

no test coverage detected