Skip to content
This repository was archived by the owner on Jan 30, 2025. It is now read-only.

Commit 02b26f5

Browse files
committed
Fix jshandle.evaluateHandle
Adding itself as the first argument which is the expected behaviour.
1 parent 136cc5f commit 02b26f5

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

common/js_handle.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ func (h *BaseJSHandle) Evaluate(pageFunc string, args ...any) (any, error) {
135135

136136
// EvaluateHandle will evaluate provided page function within an execution context.
137137
func (h *BaseJSHandle) EvaluateHandle(pageFunc string, args ...any) (JSHandleAPI, error) {
138+
args = append([]any{h}, args...)
138139
eh, err := h.execCtx.EvalHandle(h.ctx, pageFunc, args...)
139140
if err != nil {
140141
return nil, fmt.Errorf("evaluating handle for element: %w", err)

0 commit comments

Comments
 (0)