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

Method proxySetPostCheck

proxy.go:645–655  ·  view source on GitHub ↗
(targetProp, value Value, name fmt.Stringer)

Source from the content-addressed store, hash-verified

643}
644
645func (p *proxyObject) proxySetPostCheck(targetProp, value Value, name fmt.Stringer) {
646 if prop, ok := targetProp.(*valueProperty); ok {
647 if prop.accessor {
648 if !prop.configurable && prop.setterFunc == nil {
649 panic(p.val.runtime.NewTypeError("'set' on proxy: trap returned truish for property '%s' which exists in the proxy target as a non-configurable and non-writable accessor property without a setter", name.String()))
650 }
651 } else if !prop.configurable && !prop.writable && !p.__sameValue(prop.value, value) {
652 panic(p.val.runtime.NewTypeError("'set' on proxy: trap returned truish for property '%s' which exists in the proxy target as a non-configurable and non-writable data property with a different value", name.String()))
653 }
654 }
655}
656
657func (p *proxyObject) proxySetStr(name unistring.String, value, receiver Value, throw bool) bool {
658 target := p.target

Callers 3

proxySetStrMethod · 0.95
proxySetIdxMethod · 0.95
proxySetSymMethod · 0.95

Calls 3

__sameValueMethod · 0.95
NewTypeErrorMethod · 0.80
StringMethod · 0.65

Tested by

no test coverage detected