Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Mihail Stoykov <312246+mstoykov@users.noreply.github.com>
  • Loading branch information
oleiade and mstoykov committed Jul 7, 2023
1 parent 606d2ee commit 0fe402c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions js/promises/promises.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
//
// Calling the function will create a goja promise and return its `resolve` and `reject` callbacks, wrapped
// in such a way that it will block the k6 JS runtime's event loop from exiting before they are
// called, even if the promise isn't revoled by the time the current script ends executing.
// called, even if the promise isn't resolved by the time the current script ends executing.
//
// A typical usage would be:
//
Expand All @@ -27,10 +27,10 @@ import (
// }()
// return promise
// }
func MakeHandledPromise(vu modules.VU) (*goja.Promise, func(interface{}), func(interface{})) {
func MakeHandledPromise(vu modules.VU) (promise *Promise, resolve func(result interface{}), reject func(reason interface{})) {

Check failure on line 30 in js/promises/promises.go

View workflow job for this annotation

GitHub Actions / lint

undefined: Promise

Check failure on line 30 in js/promises/promises.go

View workflow job for this annotation

GitHub Actions / test-current-cov (1.20.x, ubuntu-latest)

undefined: Promise

Check failure on line 30 in js/promises/promises.go

View workflow job for this annotation

GitHub Actions / test-current-cov (1.20.x, windows-2019)

undefined: Promise

Check failure on line 30 in js/promises/promises.go

View workflow job for this annotation

GitHub Actions / test-prev (1.19.x, ubuntu-latest)

undefined: Promise

Check failure on line 30 in js/promises/promises.go

View workflow job for this annotation

GitHub Actions / test-prev (1.19.x, windows-2019)

undefined: Promise

Check failure on line 30 in js/promises/promises.go

View workflow job for this annotation

GitHub Actions / test-tip (ubuntu-latest)

undefined: Promise

Check failure on line 30 in js/promises/promises.go

View workflow job for this annotation

GitHub Actions / test-tip (windows-2019)

undefined: Promise
runtime := vu.Runtime()
callback := vu.RegisterCallback()
promise, resolve, reject := runtime.NewPromise()

Check failure on line 32 in js/promises/promises.go

View workflow job for this annotation

GitHub Actions / lint

no new variables on left side of := (typecheck)

Check failure on line 32 in js/promises/promises.go

View workflow job for this annotation

GitHub Actions / test-current-cov (1.20.x, ubuntu-latest)

no new variables on left side of :=

Check failure on line 32 in js/promises/promises.go

View workflow job for this annotation

GitHub Actions / test-current-cov (1.20.x, windows-2019)

no new variables on left side of :=

Check failure on line 32 in js/promises/promises.go

View workflow job for this annotation

GitHub Actions / test-prev (1.19.x, ubuntu-latest)

no new variables on left side of :=

Check failure on line 32 in js/promises/promises.go

View workflow job for this annotation

GitHub Actions / test-prev (1.19.x, windows-2019)

no new variables on left side of :=

Check failure on line 32 in js/promises/promises.go

View workflow job for this annotation

GitHub Actions / test-tip (ubuntu-latest)

no new variables on left side of :=

Check failure on line 32 in js/promises/promises.go

View workflow job for this annotation

GitHub Actions / test-tip (windows-2019)

no new variables on left side of :=
callback := vu.RegisterCallback()

return promise, func(i interface{}) {
callback(func() error {
Expand Down

0 comments on commit 0fe402c

Please sign in to comment.