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

Method proto

proxy.go:302–316  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

300}
301
302func (p *proxyObject) proto() *Object {
303 target := p.target
304 if v, ok := p.checkHandler().getPrototypeOf(target); ok {
305 var handlerProto *Object
306 if v != _null {
307 handlerProto = p.val.runtime.toObject(v)
308 }
309 if !target.self.isExtensible() && !p.__sameValue(handlerProto, target.self.proto()) {
310 panic(p.val.runtime.NewTypeError("'getPrototypeOf' on proxy: proxy target is non-extensible but the trap did not return its actual prototype"))
311 }
312 return handlerProto
313 }
314
315 return target.self.proto()
316}
317
318func (p *proxyObject) setProto(proto *Object, throw bool) bool {
319 target := p.target

Callers

nothing calls this directly

Calls 7

checkHandlerMethod · 0.95
__sameValueMethod · 0.95
NewTypeErrorMethod · 0.80
getPrototypeOfMethod · 0.65
toObjectMethod · 0.65
isExtensibleMethod · 0.65
protoMethod · 0.65

Tested by

no test coverage detected