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

Method Method

class.go:169–177  ·  view source on GitHub ↗

Method adds an instance method to the class - unchanged Instance methods are called on object instances

(name string, fn ClassMethodFunc)

Source from the content-addressed store, hash-verified

167// Method adds an instance method to the class - unchanged
168// Instance methods are called on object instances
169func (cb *ClassBuilder) Method(name string, fn ClassMethodFunc) *ClassBuilder {
170 cb.methods = append(cb.methods, MethodEntry{
171 Name: name,
172 Func: fn,
173 Static: false,
174 Length: 0,
175 })
176 return cb
177}
178
179// StaticMethod adds a static method to the class - unchanged
180// Static methods are called on the constructor function itself

Callers 8

addReflectionMethodsFunction · 0.80
createMethodWrapperFunction · 0.80
createPointClassFunction · 0.80
TestErrorHandlingFunction · 0.80
TestMemoryManagementFunction · 0.80

Calls

no outgoing calls