Skip to content

fix: propagate exceptions thrown by property getters on objects passed across the contextBridge - #53289

Merged
MarshallOfSound merged 1 commit into
mainfrom
fix/context-bridge-throwing-getter
Aug 29, 2026
Merged

MarshallOfSound merged 1 commit into
mainfrom
fix/context-bridge-throwing-getter

Conversation

@MarshallOfSound

Copy link
Copy Markdown
Member

Description of Change

  • When an object passed across contextBridge has a property getter that throws, rethrow to the caller instead of silently dropping the property and continuing the call — consistent with how array elements are already handled.
  • Same for an Error argument whose message getter throws.
  • Adds a spec covering both cases.

Checklist

Release Notes

Notes: Fixed an issue where an exception thrown by a property getter on an object passed through contextBridge was swallowed instead of being thrown back to the caller.

…d across the contextBridge

Objects passed as arguments across the context bridge are copied
property-by-property. If reading a property threw, the property was
skipped and the call proceeded, unlike array elements where the
exception is propagated to the caller. The same applied to reading
`message` from an Error argument. Both now abort the conversion and
rethrow to the caller, matching the array behaviour.
@MarshallOfSound MarshallOfSound added semver/patch backwards-compatible bug fixes target/43-x-y PR should also be added to the "43-x-y" branch. target/44-x-y PR should also be added to the "44-x-y" branch. target/45-x-y PR should also be added to the "45-x-y" branch. labels Aug 28, 2026
@electron-cation electron-cation Bot added the new-pr 🌱 PR opened recently label Aug 28, 2026
@MarshallOfSound
MarshallOfSound enabled auto-merge (squash) August 28, 2026 23:36
@MarshallOfSound
MarshallOfSound merged commit 2efc9f1 into main Aug 29, 2026
108 checks passed
@MarshallOfSound
MarshallOfSound deleted the fix/context-bridge-throwing-getter branch August 29, 2026 00:57
@release-clerk

release-clerk Bot commented Aug 29, 2026

Copy link
Copy Markdown

Release Notes Persisted

Fixed an issue where an exception thrown by a property getter on an object passed through contextBridge was swallowed instead of being thrown back to the caller.

@trop

trop Bot commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

I was unable to backport this PR to "44-x-y" cleanly;
you will need to perform this backport manually.

@trop

trop Bot commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

I was unable to backport this PR to "43-x-y" cleanly;
you will need to perform this backport manually.

@trop trop Bot added needs-manual-bp/44-x-y and removed target/44-x-y PR should also be added to the "44-x-y" branch. target/43-x-y PR should also be added to the "43-x-y" branch. labels Aug 29, 2026
@trop

trop Bot commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

I have automatically backported this PR to "45-x-y", please check out #53297

@trop

trop Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

@MarshallOfSound has manually backported this PR to "43-x-y", please check out #53334

@trop

trop Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

@MarshallOfSound has manually backported this PR to "44-x-y", please check out #53335

MarshallOfSound added a commit that referenced this pull request Aug 31, 2026
…d across the contextBridge (#53334)

fix: propagate exceptions thrown by property getters on objects passed across the contextBridge (#53289)

Objects passed as arguments across the context bridge are copied
property-by-property. If reading a property threw, the property was
skipped and the call proceeded, unlike array elements where the
exception is propagated to the caller. The same applied to reading
`message` from an Error argument. Both now abort the conversion and
rethrow to the caller, matching the array behaviour.

(cherry picked from commit 2efc9f1)
@trop trop Bot added merged/43-x-y PR was merged to the "43-x-y" branch. and removed in-flight/43-x-y labels Aug 31, 2026
MarshallOfSound added a commit that referenced this pull request Aug 31, 2026
…d across the contextBridge (#53289)

Objects passed as arguments across the context bridge are copied
property-by-property. If reading a property threw, the property was
skipped and the call proceeded, unlike array elements where the
exception is propagated to the caller. The same applied to reading
`message` from an Error argument. Both now abort the conversion and
rethrow to the caller, matching the array behaviour.

(cherry picked from commit 2efc9f1)
MarshallOfSound added a commit that referenced this pull request Aug 31, 2026
…d across the contextBridge (#53335)

fix: propagate exceptions thrown by property getters on objects passed across the contextBridge (#53289)

Objects passed as arguments across the context bridge are copied
property-by-property. If reading a property threw, the property was
skipped and the call proceeded, unlike array elements where the
exception is propagated to the caller. The same applied to reading
`message` from an Error argument. Both now abort the conversion and
rethrow to the caller, matching the array behaviour.

(cherry picked from commit 2efc9f1)
@trop trop Bot added merged/44-x-y PR was merged to the "44-x-y" branch. and removed in-flight/44-x-y labels Aug 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

46-x-y merged/43-x-y PR was merged to the "43-x-y" branch. merged/44-x-y PR was merged to the "44-x-y" branch. merged/45-x-y PR was merged to the "45-x-y" branch. new-pr 🌱 PR opened recently semver/patch backwards-compatible bug fixes

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

3 participants