Skip to content

Commit

Permalink
Remove redundant conversion to goja.Value
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivan Mirić committed Jun 7, 2021
1 parent ab837b2 commit 34a17f5
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions js/modules/k6/http/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -434,8 +434,7 @@ func (h *HTTP) prepareBatchObject(

// Batch makes multiple simultaneous HTTP requests. The provideds reqsV should be an array of request
// objects. Batch returns an array of responses and/or error
func (h *HTTP) Batch(ctx context.Context, reqsV goja.Value) (goja.Value, error) ***REMOVED***
rt := common.GetRuntime(ctx)
func (h *HTTP) Batch(ctx context.Context, reqsV goja.Value) (interface***REMOVED******REMOVED***, error) ***REMOVED***
state := lib.GetState(ctx)
if state == nil ***REMOVED***
return nil, ErrBatchForbiddenInInitContext
Expand All @@ -461,7 +460,7 @@ func (h *HTTP) Batch(ctx context.Context, reqsV goja.Value) (goja.Value, error)
return nil, err
***REMOVED***
state.Logger.WithField("error", err).Warn("A batch request failed")
return rt.ToValue(results), nil
return results, nil
***REMOVED***

reqCount := len(batchReqs)
Expand All @@ -476,7 +475,7 @@ func (h *HTTP) Batch(ctx context.Context, reqsV goja.Value) (goja.Value, error)
err = e
***REMOVED***
***REMOVED***
return rt.ToValue(results), err
return results, err
***REMOVED***

func (h *HTTP) parseBatchRequest(
Expand Down

0 comments on commit 34a17f5

Please sign in to comment.