Skip to content

Cross-realm Error objects are not recognized in event processing #22925

Description

@davidmurdoch

Some error-processing paths use instanceof Error, instanceof TypeError, or an equivalent current-realm constructor check. Errors created by another JavaScript realm do not share the current realm constructor prototype, so these checks fail.

This can cause linked causes and AggregateError children to be dropped, error-valued object properties to be treated as plain data, and fetch TypeError messages not to receive hostname enhancement.

The SDK already exposes the realm-tolerant isError helper. These call sites should use it and, where needed, verify error.name to retain the TypeError restriction.

Metadata

Metadata

Assignees

Labels

CorejavascriptPull requests that update javascript code

Projects

Status
No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions