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

Method StaticMethod

class.go:181–189  ·  view source on GitHub ↗

StaticMethod adds a static method to the class - unchanged Static methods are called on the constructor function itself

(name string, fn ClassMethodFunc)

Source from the content-addressed store, hash-verified

179// StaticMethod adds a static method to the class - unchanged
180// Static methods are called on the constructor function itself
181func (cb *ClassBuilder) StaticMethod(name string, fn ClassMethodFunc) *ClassBuilder {
182 cb.methods = append(cb.methods, MethodEntry{
183 Name: name,
184 Func: fn,
185 Static: true,
186 Length: 0,
187 })
188 return cb
189}
190
191// Accessor adds a read-write accessor to the class instance - unchanged
192// Pass nil for getter to create write-only accessor

Callers 1

createPointClassFunction · 0.80

Calls

no outgoing calls

Tested by 1

createPointClassFunction · 0.64