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

Method defineOwnPropertyIdx

string.go:244–252  ·  view source on GitHub ↗
(idx valueInt, descr PropertyDescriptor, throw bool)

Source from the content-addressed store, hash-verified

242}
243
244func (s *stringObject) defineOwnPropertyIdx(idx valueInt, descr PropertyDescriptor, throw bool) bool {
245 i := int64(idx)
246 if i >= 0 && i < int64(s.length) {
247 s.val.runtime.typeErrorResult(throw, "Cannot redefine property: %d", i)
248 return false
249 }
250
251 return s.baseObject.defineOwnPropertyStr(idx.string(), descr, throw)
252}
253
254type stringPropIter struct {
255 str String // separate, because obj can be the singleton

Callers

nothing calls this directly

Calls 3

typeErrorResultMethod · 0.80
defineOwnPropertyStrMethod · 0.65
stringMethod · 0.65

Tested by

no test coverage detected