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

Method defineOwnPropertyStr

object_gomap.go:85–98  ·  view source on GitHub ↗
(name unistring.String, descr PropertyDescriptor, throw bool)

Source from the content-addressed store, hash-verified

83}
84
85func (o *objectGoMapSimple) defineOwnPropertyStr(name unistring.String, descr PropertyDescriptor, throw bool) bool {
86 if !o.val.runtime.checkHostObjectPropertyDescr(name, descr, throw) {
87 return false
88 }
89
90 n := name.String()
91 if o.extensible || o._hasStr(n) {
92 o.data[n] = descr.Value.Export()
93 return true
94 }
95
96 o.val.runtime.typeErrorResult(throw, "Cannot define property %s, object is not extensible", n)
97 return false
98}
99
100func (o *objectGoMapSimple) deleteStr(name unistring.String, _ bool) bool {
101 delete(o.data, name.String())

Callers

nothing calls this directly

Calls 5

_hasStrMethod · 0.95
typeErrorResultMethod · 0.80
StringMethod · 0.65
ExportMethod · 0.65

Tested by

no test coverage detected