Fix identifier unicode escaping for parameter props#3188
Open
jakebailey wants to merge 1 commit intomainfrom
Open
Fix identifier unicode escaping for parameter props#3188jakebailey wants to merge 1 commit intomainfrom
jakebailey wants to merge 1 commit intomainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes a codegen discrepancy in the TypeScript runtime-syntax transformer where cloned identifier nodes for parameter properties lost their parent pointers, causing the printer to emit normalized identifier text instead of preserving original unicode escape sequences.
Changes:
- Set
Parenton clonedpropertyName/localNameidentifiers emitted for parameter-property constructor assignments. - Update the
escapedIdentifiersreference baseline to reflect preserved unicode escapes inthis.<prop> = <param>assignments. - Remove the now-unnecessary
escapedIdentifiers.js.diffbaseline diff file.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
internal/transformers/tstransforms/runtimesyntax.go |
Ensures cloned parameter-property identifiers are parented so the printer can recover escaped source text. |
testdata/baselines/reference/submodule/compiler/escapedIdentifiers.js |
Updates expected emit output to keep unicode escapes for parameter-property assignments. |
testdata/baselines/reference/submodule/compiler/escapedIdentifiers.js.diff |
Removes the diff baseline since the outputs now match. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The original code was:
To answer the TODO... yes, apparently.