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

Method defineOwnPropertyStr

array_sparse.go:376–384  ·  view source on GitHub ↗
(name unistring.String, descr PropertyDescriptor, throw bool)

Source from the content-addressed store, hash-verified

374}
375
376func (a *sparseArrayObject) defineOwnPropertyStr(name unistring.String, descr PropertyDescriptor, throw bool) bool {
377 if idx := strToArrayIdx(name); idx != math.MaxUint32 {
378 return a._defineIdxProperty(idx, descr, throw)
379 }
380 if name == "length" {
381 return a.val.runtime.defineArrayLength(a.getLengthProp(), descr, a.setLength, throw)
382 }
383 return a.baseObject.defineOwnPropertyStr(name, descr, throw)
384}
385
386func (a *sparseArrayObject) defineOwnPropertyIdx(idx valueInt, descr PropertyDescriptor, throw bool) bool {
387 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