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

Method setOwnIdx

string.go:217–225  ·  view source on GitHub ↗
(idx valueInt, val Value, throw bool)

Source from the content-addressed store, hash-verified

215}
216
217func (s *stringObject) setOwnIdx(idx valueInt, val Value, throw bool) bool {
218 i := int64(idx)
219 if i >= 0 && i < int64(s.length) {
220 s.val.runtime.typeErrorResult(throw, "Cannot assign to read only property '%d' of a String", i)
221 return false
222 }
223
224 return s.baseObject.setOwnStr(idx.string(), val, throw)
225}
226
227func (s *stringObject) setForeignStr(name unistring.String, val, receiver Value, throw bool) (bool, bool) {
228 return s._setForeignStr(name, s.getOwnPropStr(name), val, receiver, throw)

Callers

nothing calls this directly

Calls 3

typeErrorResultMethod · 0.80
setOwnStrMethod · 0.65
stringMethod · 0.65

Tested by

no test coverage detected