StaticMethod adds a static method to the class - unchanged Static methods are called on the constructor function itself
(name string, fn ClassMethodFunc)
| 179 | // StaticMethod adds a static method to the class - unchanged |
| 180 | // Static methods are called on the constructor function itself |
| 181 | func (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 |
no outgoing calls