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

Method Constructor

class.go:162–165  ·  view source on GitHub ↗

============================================================================= CLASSBUILDER FLUENT API METHODS ============================================================================= Constructor sets the constructor function for the class MODIFIED FOR SCHEME C: Now uses new constructor signatur

(fn ClassConstructorFunc)

Source from the content-addressed store, hash-verified

160// MODIFIED FOR SCHEME C: Now uses new constructor signature
161// The constructor function will be called with pre-created instance
162func (cb *ClassBuilder) Constructor(fn ClassConstructorFunc) *ClassBuilder {
163 cb.constructor = fn
164 return cb
165}
166
167// Method adds an instance method to the class - unchanged
168// Instance methods are called on object instances

Calls

no outgoing calls