123456789101112131415161718192021222324252627 |
- package objects
- import "github.com/d5/tengo/v2"
- const src = `
- new := func() {
- self := {}
- self.def = func(name, method){
- self[name] = func(...args){
- return method(self, args...)
- }
- }
- return self
- }
- export {
- new: new
- }
- `
- func GetModule() tengo.Importable {
- return &tengo.SourceModule{
- Src: []byte(src),
- }
- }
|