| 585 | } |
| 586 | |
| 587 | func (p *proxyObject) proxyGetChecks(targetProp, trapResult Value, name fmt.Stringer) { |
| 588 | if targetDesc, ok := targetProp.(*valueProperty); ok { |
| 589 | if !targetDesc.accessor { |
| 590 | if !targetDesc.writable && !targetDesc.configurable && !trapResult.SameAs(targetDesc.value) { |
| 591 | panic(p.val.runtime.NewTypeError("'get' on proxy: property '%s' is a read-only and non-configurable data property on the proxy target but the proxy did not return its actual value (expected '%s' but got '%s')", name.String(), nilSafe(targetDesc.value), ret)) |
| 592 | } |
| 593 | } else { |
| 594 | if !targetDesc.configurable && targetDesc.getterFunc == nil && trapResult != _undefined { |
| 595 | panic(p.val.runtime.NewTypeError("'get' on proxy: property '%s' is a non-configurable accessor property on the proxy target and does not have a getter function, but the trap did not return 'undefined' (got '%s')", name.String(), ret)) |
| 596 | } |
| 597 | } |
| 598 | } |
| 599 | } |
| 600 | |
| 601 | func (p *proxyObject) getStr(name unistring.String, receiver Value) Value { |
| 602 | target := p.target |