Skip to content

fix(compiler): quote object keys containing dots or hyphens in inputs/outputs#155

Merged
Brooooooklyn merged 2 commits intovoidzero-dev:mainfrom
ashley-hunter:fix/unquoted-inputs
Mar 21, 2026
Merged

fix(compiler): quote object keys containing dots or hyphens in inputs/outputs#155
Brooooooklyn merged 2 commits intovoidzero-dev:mainfrom
ashley-hunter:fix/unquoted-inputs

Conversation

@ashley-hunter
Copy link
Contributor

@ashley-hunter ashley-hunter commented Mar 20, 2026

Summary

  • Fix object property keys containing dots (.) or hyphens (-) not being quoted in compiled inputs/outputs maps, matching Angular's UNSAFE_OBJECT_KEY_NAME_REGEXP from render3/view/util.ts
  • Applied the fix to both the directive compiler and the linker
  • Added unit tests and snapshot tests covering dotted, hyphenated, and simple identifier keys for both inputs and outputs
  • Required for libs like flex layout, but inputs and outputs can contain periods or hyphens in general

Test plan

  • Unit tests for create_inputs_literal and create_outputs_literal with dotted, hyphenated, and simple keys
  • Snapshot tests for the linker covering all input formats (string, array, object) and outputs with special characters
  • Verified simple identifier keys remain unquoted

🤖 Generated with Claude Code

ashley-hunter and others added 2 commits March 20, 2026 13:52
…/outputs

Angular's UNSAFE_OBJECT_KEY_NAME_REGEXP requires quoting property keys
that contain `.` or `-` characters (e.g. `fxFlexAlign.xs`). Without
quoting, these produce invalid JavaScript object literals.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@Brooooooklyn Brooooooklyn merged commit 8738f85 into voidzero-dev:main Mar 21, 2026
2 checks passed
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.

2 participants