Skip to content

Conversation

@hamishwillee
Copy link
Collaborator

The Function() constructor can execute its arguments as JavaScript - it is similarly dangerous as eval().

This updates the TrustedType information.
Note, I haven't provided an example. Even though this is notionally safer than not using trusted types, there is really no direction on how you can practically and generically transform a script so that it is safe.

Related docs work tracked in #41507

@hamishwillee hamishwillee requested a review from a team as a code owner December 19, 2025 05:57
@hamishwillee hamishwillee requested review from Josh-Cena and wbamberg and removed request for a team December 19, 2025 05:57
@github-actions github-actions bot added Content:JS JavaScript docs size/m [PR only] 51-500 LoC changed labels Dec 19, 2025
@github-actions
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Content:JS JavaScript docs size/m [PR only] 51-500 LoC changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant