bun-unsafe

#53205: fix: reject non-integer worldId in executeJavaScriptInIsolatedWorld

Merged
Created: Aug 26, 2026, 10:20:54 AM
Merged: Aug 27, 2026, 2:55:51 PM
5 comments
Target: main

Description of Change

webContents.executeJavaScriptInIsolatedWorld forwarded worldId to the renderer with no integer check.

  • Integer worldId (e.g. 1234) evaluates the script and resolves with the result.
  • String worldId (e.g. '1234') resolved the promise with undefined and did not reject.

The docs describe worldId as an Integer. This change throws TypeError: worldId must be an integer for non-integer values, matching other Electron APIs that reject bad argument types instead of succeeding silently.

Checklist

Test plan

  • Official: yarn test -match=executeJavaScriptInIsolatedWorld
  • Existing isolated-world result test still passes with integer 999
  • New test: string '1234' is rejected with TypeError

Release Notes

Notes: Fixed webContents.executeJavaScriptInIsolatedWorld resolving with undefined when worldId was not an integer.

Backports

43-x-y
Merged
PR Number
#53237
Merged At
Aug 27, 2026, 4:33:22 PM
Released In
Not yet
Release Date
Not yet
44-x-y
Merged
PR Number
#53238
Merged At
Aug 27, 2026, 4:31:56 PM
Released In
Not yet
Release Date
Not yet

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