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

Method defineOwnPropertySym

object.go:771–784  ·  view source on GitHub ↗
(s *Symbol, descr PropertyDescriptor, throw bool)

Source from the content-addressed store, hash-verified

769}
770
771func (o *baseObject) defineOwnPropertySym(s *Symbol, descr PropertyDescriptor, throw bool) bool {
772 var existingVal Value
773 if o.symValues != nil {
774 existingVal = o.symValues.get(s)
775 }
776 if v, ok := o._defineOwnProperty(s.descriptiveString().string(), existingVal, descr, throw); ok {
777 if o.symValues == nil {
778 o.symValues = newOrderedMap(nil)
779 }
780 o.symValues.set(s, v)
781 return true
782 }
783 return false
784}
785
786func (o *baseObject) _put(name unistring.String, v Value) {
787 if _, exists := o.values[name]; !exists {

Callers

nothing calls this directly

Calls 6

_defineOwnPropertyMethod · 0.95
newOrderedMapFunction · 0.85
descriptiveStringMethod · 0.80
getMethod · 0.65
stringMethod · 0.65
setMethod · 0.65

Tested by

no test coverage detected