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

Method setOwnStr

string.go:208–215  ·  view source on GitHub ↗
(name unistring.String, val Value, throw bool)

Source from the content-addressed store, hash-verified

206}
207
208func (s *stringObject) setOwnStr(name unistring.String, val Value, throw bool) bool {
209 if i := strToGoIdx(name); i >= 0 && i < s.length {
210 s.val.runtime.typeErrorResult(throw, "Cannot assign to read only property '%d' of a String", i)
211 return false
212 }
213
214 return s.baseObject.setOwnStr(name, val, throw)
215}
216
217func (s *stringObject) setOwnIdx(idx valueInt, val Value, throw bool) bool {
218 i := int64(idx)

Callers

nothing calls this directly

Calls 3

strToGoIdxFunction · 0.85
typeErrorResultMethod · 0.80
setOwnStrMethod · 0.65

Tested by

no test coverage detected