-
Notifications
You must be signed in to change notification settings - Fork 61k
fix(editor): Node references in expressions not updated when the renamed node has quotes #27371
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -126,10 +126,50 @@ describe('NodeReferenceParserUtils', () => { | |
| expected: 'someRandomExpression("oldName")', | ||
| }, | ||
| { | ||
| expression: '$("old\\"Name")', | ||
| previousName: 'old\\"Name', | ||
| expression: '$("someone\'s node")', | ||
| previousName: "someone's node", | ||
| newName: 'other node', | ||
| expected: '$("other node")', | ||
| }, | ||
| { | ||
| expression: '$(\'some "node"\')', | ||
| previousName: 'some "node"', | ||
| newName: 'other node', | ||
| expected: "$('other node')", | ||
| }, | ||
| { | ||
| expression: '$("test\\\\some")', | ||
| previousName: 'test\\some', | ||
| newName: 'other node', | ||
| expected: '$("other node")', | ||
| }, | ||
| { | ||
| expression: '$("old name")', | ||
| previousName: 'old name', | ||
| newName: 'new "name"', | ||
| expected: '$("new \\"name\\"")', | ||
| }, | ||
| { | ||
| expression: '$("old name")', | ||
| previousName: 'old name', | ||
| newName: "new 'name'", | ||
| expected: '$("new \\\'name\\\'")', | ||
| }, | ||
| { | ||
| expression: '$("test some")', | ||
| previousName: 'test some', | ||
| newName: 'other\\node', | ||
| expected: '$("other\\\\node")', | ||
| }, | ||
| { | ||
| // $("old\"Na\\me\'") -> old"Na\me' | ||
| expression: '$("old\\"Na\\\\me\\\'")', | ||
| // old"Na\me' | ||
| previousName: 'old"Na\\me\'', | ||
| // n\'ew\"Name | ||
| newName: 'n\\\'ew\\"Name', | ||
| expected: '$("n\\\'ew\\"Name")', | ||
| // $("n\\\'ew\\\"Name") -> n\'ew\"Name | ||
| expected: '$("n\\\\\\\'ew\\\\\\"Name")', | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This one doesn't quite seem right,
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 6 In a case with 5
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What a mess 😢 |
||
| }, | ||
| ])( | ||
| 'should correctly transform expression "$expression" with previousName "$previousName" and newName "$newName"', | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a little confused why:
new "name"ends up as'$("new \\"name\\"")'(double back slash)When:
"new 'name'"returns'$("new \\\'name\\\'")'(triple back slash)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the case with single quotes the third slash is needed to escape the quotes around
name, since theexpectedstring is itself is wrapped in single quotes