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

Method proxyHasChecks

proxy.go:449–459  ·  view source on GitHub ↗
(targetProp Value, target *Object, name fmt.Stringer)

Source from the content-addressed store, hash-verified

447}
448
449func (p *proxyObject) proxyHasChecks(targetProp Value, target *Object, name fmt.Stringer) {
450 targetDesc := propToValueProp(targetProp)
451 if targetDesc != nil {
452 if !targetDesc.configurable {
453 panic(p.val.runtime.NewTypeError("'has' on proxy: trap returned falsish for property '%s' which exists in the proxy target as non-configurable", name.String()))
454 }
455 if !target.self.isExtensible() {
456 panic(p.val.runtime.NewTypeError("'has' on proxy: trap returned falsish for property '%s' but the proxy target is not extensible", name.String()))
457 }
458 }
459}
460
461func (p *proxyObject) hasPropertyStr(name unistring.String) bool {
462 target := p.target

Callers 3

hasPropertyStrMethod · 0.95
hasPropertyIdxMethod · 0.95
hasPropertySymMethod · 0.95

Calls 4

propToValuePropFunction · 0.85
NewTypeErrorMethod · 0.80
StringMethod · 0.65
isExtensibleMethod · 0.65

Tested by

no test coverage detected