MarshallOfSound

#54358: fix: don't throw from gfx geometry converters

Merged
Created: Sep 25, 2026, 5:19:21 AM
Merged: Sep 25, 2026, 5:27:41 AM
3 comments
Target: main

Human: @MarshallOfSound

Requested by Sam · project thread

Description of Change

Follow-up to #54216. That PR made the gfx::Point, gfx::Rect and gfx::Insets converters throw a JS error from inside FromV8. A gin converter should only signal failure by returning false: the dispatcher in gin_helper/function_template already raises the "Error processing argument at index N, conversion failure" TypeError with the correct index, and the same converters are also reached from places where a failed conversion is not an error at all (optional arguments, Dictionary::Get on options objects, nested converters), where a pending exception would leak out of an otherwise successful call.

This keeps the finite / int-range validation from #54216 but turns it back into a plain return false, so callers get the normal conversion-failure error from the dispatcher. Adds a setContentBounds spec that goes through the gfx::Rect converter path.

Note: since #54333, BaseWindow.setBounds() no longer uses the gfx::Rect converter, so the existing setBounds spec from #54216 is covered by #54357 rather than this change.

Checklist

Release Notes

Notes: none


Generated by Claude Code

Backports

No Backports Requested

This pull request doesn't have any backports requested or created for older release branches.

What are backports?

Backports are copies of changes made to the main branch that are applied to older release branches. They ensure that bug fixes and important changes are available in maintained older versions of Electron.

Semver Impact

Major
Breaking changes
Minor
New features
Patch
Bug fixes
None
Docs, tests, etc.

Semantic Versioning helps users understand the impact of updates:

  • Major (X.y.z): Breaking changes that may require code modifications
  • Minor (x.Y.z): New features that maintain backward compatibility
  • Patch (x.y.Z): Bug fixes that don't change the API
  • None: Changes that don't affect using facing parts of Electron