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

Method defineOwnPropertyStr

array.go:447–455  ·  view source on GitHub ↗
(name unistring.String, descr PropertyDescriptor, throw bool)

Source from the content-addressed store, hash-verified

445}
446
447func (a *arrayObject) defineOwnPropertyStr(name unistring.String, descr PropertyDescriptor, throw bool) bool {
448 if idx := strToArrayIdx(name); idx != math.MaxUint32 {
449 return a._defineIdxProperty(idx, descr, throw)
450 }
451 if name == "length" {
452 return a.val.runtime.defineArrayLength(a.getLengthProp(), descr, a.setLength, throw)
453 }
454 return a.baseObject.defineOwnPropertyStr(name, descr, throw)
455}
456
457func (a *arrayObject) defineOwnPropertyIdx(idx valueInt, descr PropertyDescriptor, throw bool) bool {
458 if idx := toIdx(idx); idx != math.MaxUint32 {

Callers

nothing calls this directly

Calls 5

_defineIdxPropertyMethod · 0.95
getLengthPropMethod · 0.95
strToArrayIdxFunction · 0.85
defineArrayLengthMethod · 0.80
defineOwnPropertyStrMethod · 0.65

Tested by

no test coverage detected