MCPcopy Create free account
hub / github.com/buke/quickjs-go / SetPrototype

Method SetPrototype

value.go:762–767  ·  view source on GitHub ↗

SetPrototype sets the object's prototype.

(proto *Value)

Source from the content-addressed store, hash-verified

760
761// SetPrototype sets the object's prototype.
762func (v *Value) SetPrototype(proto *Value) bool {
763 if !v.isAlive() || !proto.belongsTo(v.ctx) {
764 return false
765 }
766 return C.JS_SetPrototype(v.ctx.ref, v.ref, proto.ref) == 1
767}
768
769// IsExtensible returns true if new properties can still be added.
770func (v *Value) IsExtensible() bool {

Calls 2

isAliveMethod · 0.95
belongsToMethod · 0.80