(prop Value, target *Object, descr PropertyDescriptor)
| 383 | } |
| 384 | |
| 385 | func (p *proxyObject) proxyDefineOwnPropertyPostCheck(prop Value, target *Object, descr PropertyDescriptor) { |
| 386 | targetDesc := propToValueProp(prop) |
| 387 | extensibleTarget := target.self.isExtensible() |
| 388 | settingConfigFalse := descr.Configurable == FLAG_FALSE |
| 389 | if targetDesc == nil { |
| 390 | if !extensibleTarget { |
| 391 | panic(p.val.runtime.NewTypeError()) |
| 392 | } |
| 393 | if settingConfigFalse { |
| 394 | panic(p.val.runtime.NewTypeError()) |
| 395 | } |
| 396 | } else { |
| 397 | if !p.__isCompatibleDescriptor(extensibleTarget, &descr, targetDesc) { |
| 398 | panic(p.val.runtime.NewTypeError()) |
| 399 | } |
| 400 | if settingConfigFalse && targetDesc.configurable { |
| 401 | panic(p.val.runtime.NewTypeError()) |
| 402 | } |
| 403 | if targetDesc.value != nil && !targetDesc.configurable && targetDesc.writable { |
| 404 | if descr.Writable == FLAG_FALSE { |
| 405 | panic(p.val.runtime.NewTypeError()) |
| 406 | } |
| 407 | } |
| 408 | } |
| 409 | } |
| 410 | |
| 411 | func (p *proxyObject) defineOwnPropertyStr(name unistring.String, descr PropertyDescriptor, throw bool) bool { |
| 412 | target := p.target |
no test coverage detected