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

Method defineOwnPropertyStr

string.go:235–242  ·  view source on GitHub ↗
(name unistring.String, descr PropertyDescriptor, throw bool)

Source from the content-addressed store, hash-verified

233}
234
235func (s *stringObject) defineOwnPropertyStr(name unistring.String, descr PropertyDescriptor, throw bool) bool {
236 if i := strToGoIdx(name); i >= 0 && i < s.length {
237 _, ok := s._defineOwnProperty(name, &valueProperty{enumerable: true}, descr, throw)
238 return ok
239 }
240
241 return s.baseObject.defineOwnPropertyStr(name, descr, throw)
242}
243
244func (s *stringObject) defineOwnPropertyIdx(idx valueInt, descr PropertyDescriptor, throw bool) bool {
245 i := int64(idx)

Callers

nothing calls this directly

Calls 3

strToGoIdxFunction · 0.85
_defineOwnPropertyMethod · 0.80
defineOwnPropertyStrMethod · 0.65

Tested by

no test coverage detected