clean up
This commit is contained in:
@@ -41,17 +41,16 @@ func New(ctx context.Context, opts ...RuntimeOption) (*Runtime, error) {
|
||||
}
|
||||
|
||||
func (r *Runtime) populateGlobals() error {
|
||||
// Register Custom Functions
|
||||
for name, fn := range functions.GetRegisteredFunctions() {
|
||||
// Register Main Function
|
||||
if fn.IsAsync() {
|
||||
r.ctx.SetAsyncFunc(name, func(this *qjs.This) {
|
||||
qjsVal, err := callFunc(this, fn)
|
||||
if err != nil {
|
||||
this.Promise().Reject(this.Context().NewError(err))
|
||||
_ = this.Promise().Reject(this.Context().NewError(err))
|
||||
return
|
||||
}
|
||||
this.Promise().Resolve(qjsVal)
|
||||
_ = this.Promise().Resolve(qjsVal)
|
||||
})
|
||||
} else {
|
||||
r.ctx.SetFunc(name, func(this *qjs.This) (*qjs.Value, error) {
|
||||
|
||||
Reference in New Issue
Block a user