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

Method setOwnStr

array.go:259–269  ·  view source on GitHub ↗
(name unistring.String, val Value, throw bool)

Source from the content-addressed store, hash-verified

257}
258
259func (a *arrayObject) setOwnStr(name unistring.String, val Value, throw bool) bool {
260 if idx := strToArrayIdx(name); idx != math.MaxUint32 {
261 return a._setOwnIdx(idx, val, throw)
262 } else {
263 if name == "length" {
264 return a.setLength(a.val.runtime.toLengthUint32(val), throw)
265 } else {
266 return a.baseObject.setOwnStr(name, val, throw)
267 }
268 }
269}
270
271func (a *arrayObject) setForeignIdx(idx valueInt, val, receiver Value, throw bool) (bool, bool) {
272 return a._setForeignIdx(idx, a.getOwnPropIdx(idx), val, receiver, throw)

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected