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 6, 2024
1 parent f1f03ee commit eea70f6
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions browser/browser_mapping.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,8 @@ 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 {
if err := mergeWith(rt, b, opts); err != nil {
return nil, fmt.Errorf("parsing browser context options: %w", err)
}
return b, nil
Expand Down

0 comments on commit eea70f6

Please sign in to comment.