Skip to content

fix: trigger filters on events with properties that aren't identifiers - #4124

Open
nickhstr wants to merge 1 commit into
bigskysoftware:four-devfrom
nickhstr:fix/trigger-filter-event-keys
Open

nickhstr wants to merge 1 commit into
bigskysoftware:four-devfrom
nickhstr:fix/trigger-filter-event-keys

Conversation

@nickhstr

@nickhstr nickhstr commented Oct 8, 2026

Copy link
Copy Markdown

Description

The keys used for an hx-trigger filter include every "for...in" property of an event. When the event carries a property whose name isn't an identifier, the Function constructor throws a SyntaxError.

__executeJavaScript now passes only the keys a function parameter can take: identifiers that aren't reserved words. A filter couldn't reference any other key by bare name anyway.

Corresponding issue: #4123

Testing

Added a new test case for hx-trigger.

Checklist

  • I have read the contribution guidelines
  • I have targeted this PR against the correct branch (master for website changes, dev for
    source changes)
  • This is either a bugfix, a documentation update, or a new feature that has been explicitly
    approved via an issue
  • I ran the test suite locally (npm run test) and verified that it succeeded

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