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

Method checkDynamicObjectPropertyDescr

object_dynamic.go:375–393  ·  view source on GitHub ↗
(name fmt.Stringer, descr PropertyDescriptor, throw bool)

Source from the content-addressed store, hash-verified

373}
374
375func (o *baseDynamicObject) checkDynamicObjectPropertyDescr(name fmt.Stringer, descr PropertyDescriptor, throw bool) bool {
376 if descr.Getter != nil || descr.Setter != nil {
377 typeErrorResult(throw, "Dynamic objects do not support accessor properties")
378 return false
379 }
380 if descr.Writable == FLAG_FALSE {
381 typeErrorResult(throw, "Dynamic object field %q cannot be made read-only", name.String())
382 return false
383 }
384 if descr.Enumerable == FLAG_FALSE {
385 typeErrorResult(throw, "Dynamic object field %q cannot be made non-enumerable", name.String())
386 return false
387 }
388 if descr.Configurable == FLAG_FALSE {
389 typeErrorResult(throw, "Dynamic object field %q cannot be made non-configurable", name.String())
390 return false
391 }
392 return true
393}
394
395func (o *dynamicObject) defineOwnPropertyStr(name unistring.String, desc PropertyDescriptor, throw bool) bool {
396 if o.checkDynamicObjectPropertyDescr(name, desc, throw) {

Callers 4

defineOwnPropertyStrMethod · 0.80
defineOwnPropertyIdxMethod · 0.80
defineOwnPropertyStrMethod · 0.80
defineOwnPropertyIdxMethod · 0.80

Calls 2

typeErrorResultFunction · 0.85
StringMethod · 0.65

Tested by

no test coverage detected