Skip to content

Commit

Permalink
Use mergeWith parseBrowserContextOptions
Browse files Browse the repository at this point in the history
  • Loading branch information
inancgumus committed Nov 7, 2024
1 parent f51f363 commit e59169b
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions browser/browser_mapping.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,9 @@ func initBrowserContext(bctx *common.BrowserContext, testRunID string) error {

// parseBrowserContextOptions parses the [common.BrowserContext] options from a Sobek value.
func parseBrowserContextOptions(rt *sobek.Runtime, opts sobek.Value) (*common.BrowserContextOptions, error) {
if !sobekValueExists(opts) {
return nil, nil //nolint:nilnil
}
b := common.NewBrowserContextOptions()
if err := rt.ExportTo(opts, &b); err != nil {
return nil, err //nolint:wrapcheck
if err := mergeWith(rt, b, opts); err != nil {
return nil, err
}
return b, nil
}

0 comments on commit e59169b

Please sign in to comment.