Skip to content

test(ses): isImmutableDataProperty regression for iOS Safari fix (#947) - #3314

Open
kriskowal wants to merge 1 commit into
masterfrom
test/947-isimmutabledataproperty-absent
Open

test(ses): isImmutableDataProperty regression for iOS Safari fix (#947)#3314
kriskowal wants to merge 1 commit into
masterfrom
test/947-isimmutabledataproperty-absent

Conversation

@kriskowal

Copy link
Copy Markdown
Member

Description

Adds a regression test pinning the iOS Safari lockdown() fix in packages/ses/src/scope-constants.js.

iOS Safari 15.0–15.2 reported showModalDialog in Object.getOwnPropertyNames(window) while Object.getOwnPropertyDescriptor(window, 'showModalDialog') returned undefined, breaking lockdown() with TypeError: Cannot read properties of undefined (reading 'configurable') thrown from isImmutableDataProperty. The runtime fix (a desc && guard at the head of the function) is already in place; this test pins it.

The test drives the public getScopeConstants entry point with a Proxy-backed global that lists phantom as an own name but returns undefined from getOwnPropertyDescriptor for it, mirroring the WebKit anomaly. It asserts getScopeConstants does not throw and that phantom is dropped from globalObjectConstants. Reverting the desc && guard makes the test fail with the original error — verified locally.

The test targets the public getScopeConstants rather than the unexported isImmutableDataProperty helper, so it stays stable across future refactors.

Test-only change; no runtime impact.

Reference: https://bugs.webkit.org/show_bug.cgi?id=234282

Ferried from the bot fork: endojs/endo-but-for-bots#182.

Closes #947

@changeset-bot

changeset-bot Bot commented Jun 25, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 40e3be9

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

iOS Safari 15.0-15.2 reported `showModalDialog` in
`Object.getOwnPropertyNames(window)` while
`Object.getOwnPropertyDescriptor(window, 'showModalDialog')` returned
`undefined`, breaking `lockdown()` with
`Cannot read properties of undefined (reading 'configurable')`.

The runtime fix added `desc &&` to the head of `isImmutableDataProperty`
in `packages/ses/src/scope-constants.js`. This commit pins that fix in
place with a regression test that drives `getScopeConstants` through a
Proxy global which simulates the iOS Safari anomaly.

Refs: #947
@kriskowal
kriskowal force-pushed the test/947-isimmutabledataproperty-absent branch from 50cf9b1 to 40e3be9 Compare July 16, 2026 23:18
@kriskowal
kriskowal enabled auto-merge July 16, 2026 23:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

iOS Safari fails to lockdown (with potential fix)

2 participants