Skip to content

Harden JS file address property access#400

Merged
GrahamCampbell merged 1 commit into
3.xfrom
harden-file-address-property-access
Jun 12, 2026
Merged

Harden JS file address property access#400
GrahamCampbell merged 1 commit into
3.xfrom
harden-file-address-property-access

Conversation

@GrahamCampbell

Copy link
Copy Markdown
Contributor

Following on from #396, this wraps the property access step of file address resolution in proper error handling. A property read can throw synchronously, either from a Proxy get handler or from a plain getter defined on the file's result, and until now such a crash escaped as a raw exception instead of the coded errors every other failure mode in that loop produces. The access now surfaces as a ServerlessError carrying the address and file name, in line with the existing function and promise rejection paths.

While there, the own-or-proxy traversal condition moves into a shared canFollowProperty helper in the safe-object util, next to hasOwn. It encodes the rule from #396 in one place: own properties are always followed, and Proxy-backed values are followed through their get handler except for the prototype-internal keys. Behaviour is unchanged; this just gives the rule a single home instead of an inline condition in the file source.

@GrahamCampbell GrahamCampbell merged commit 769bf45 into 3.x Jun 12, 2026
8 checks passed
@GrahamCampbell GrahamCampbell deleted the harden-file-address-property-access branch June 12, 2026 20:23
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.

1 participant