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

Method proxyDeleteCheck

proxy.go:717–733  ·  view source on GitHub ↗
(trapResult bool, targetProp Value, name fmt.Stringer, target *Object, throw bool)

Source from the content-addressed store, hash-verified

715}
716
717func (p *proxyObject) proxyDeleteCheck(trapResult bool, targetProp Value, name fmt.Stringer, target *Object, throw bool) {
718 if trapResult {
719 if targetProp == nil {
720 return
721 }
722 if targetDesc, ok := targetProp.(*valueProperty); ok {
723 if !targetDesc.configurable {
724 panic(p.val.runtime.NewTypeError("'deleteProperty' on proxy: property '%s' is a non-configurable property but the trap returned truish", name.String()))
725 }
726 }
727 if !target.self.isExtensible() {
728 panic(p.val.runtime.NewTypeError("'deleteProperty' on proxy: trap returned truish for property '%s' but the proxy target is non-extensible", name.String()))
729 }
730 } else {
731 p.val.runtime.typeErrorResult(throw, "'deleteProperty' on proxy: trap returned falsish for property '%s'", name.String())
732 }
733}
734
735func (p *proxyObject) deleteStr(name unistring.String, throw bool) bool {
736 target := p.target

Callers 3

deleteStrMethod · 0.95
deleteIdxMethod · 0.95
deleteSymMethod · 0.95

Calls 4

NewTypeErrorMethod · 0.80
typeErrorResultMethod · 0.80
StringMethod · 0.65
isExtensibleMethod · 0.65

Tested by

no test coverage detected