AsyncFunction returns a js async function value with given function template Deprecated: Use Context.NewFunction + Context.NewPromise instead for better memory management and thread safety. Example: asyncFn := ctx.NewFunction(func(ctx *quickjs.Context, this *quickjs.Value, args []*quickjs.Value)
(asyncFn func(ctx *Context, this *Value, promise *Value, args []*Value) *Value)
| 788 | // }) |
| 789 | // }) |
| 790 | func (ctx *Context) AsyncFunction(asyncFn func(ctx *Context, this *Value, promise *Value, args []*Value) *Value) *Value { |
| 791 | return ctx.NewAsyncFunction(asyncFn) |
| 792 | } |
| 793 | |
| 794 | // getFunction gets function from HandleStore (internal use) |
| 795 | func (ctx *Context) loadFunctionFromHandleID(id int32) interface{} { |