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

Method defineOwnPropertyStr

object_template.go:448–459  ·  view source on GitHub ↗
(name unistring.String, descr PropertyDescriptor, throw bool)

Source from the content-addressed store, hash-verified

446}
447
448func (a *templatedArrayObject) defineOwnPropertyStr(name unistring.String, descr PropertyDescriptor, throw bool) bool {
449 if name == "length" {
450 return a.val.runtime.defineArrayLength(a.getLenProp(), descr, a.setLength, throw)
451 }
452 if !a.templatedObject.defineOwnPropertyStr(name, descr, throw) {
453 return false
454 }
455 if idx := strToArrayIdx(name); idx != math.MaxUint32 {
456 a._setOwnIdx(idx)
457 }
458 return true
459}
460
461func (a *templatedArrayObject) defineOwnPropertyIdx(p valueInt, desc PropertyDescriptor, throw bool) bool {
462 if !a.templatedObject.defineOwnPropertyStr(p.string(), desc, throw) {

Callers

nothing calls this directly

Calls 5

getLenPropMethod · 0.95
_setOwnIdxMethod · 0.95
strToArrayIdxFunction · 0.85
defineArrayLengthMethod · 0.80
defineOwnPropertyStrMethod · 0.65

Tested by

no test coverage detected