(proto *Object, throw bool)
| 316 | } |
| 317 | |
| 318 | func (p *proxyObject) setProto(proto *Object, throw bool) bool { |
| 319 | target := p.target |
| 320 | if v, ok := p.checkHandler().setPrototypeOf(target, proto); ok { |
| 321 | if v { |
| 322 | if !target.self.isExtensible() && !p.__sameValue(proto, target.self.proto()) { |
| 323 | panic(p.val.runtime.NewTypeError("'setPrototypeOf' on proxy: trap returned truish for setting a new prototype on the non-extensible proxy target")) |
| 324 | } |
| 325 | return true |
| 326 | } else { |
| 327 | p.val.runtime.typeErrorResult(throw, "'setPrototypeOf' on proxy: trap returned falsish") |
| 328 | return false |
| 329 | } |
| 330 | } |
| 331 | |
| 332 | return target.self.setProto(proto, throw) |
| 333 | } |
| 334 | |
| 335 | func (p *proxyObject) isExtensible() bool { |
| 336 | target := p.target |
nothing calls this directly
no test coverage detected