-
Notifications
You must be signed in to change notification settings - Fork 46
Fix false naming escaping in JavaScript #1952
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
Conversation
@@ -409,8 +408,7 @@ internal class CgJsRenderer(context: CgRendererContext, printer: CgPrinter = CgP | |||
print("${exception.name.escapeNamePossibleKeyword()}: ${exception.type}") | |||
} | |||
|
|||
override fun escapeNamePossibleKeywordImpl(s: String): String = | |||
if (isLanguageKeyword(s, context.cgLanguageAssistant)) "`$s`" else s | |||
override fun escapeNamePossibleKeywordImpl(s: String): String = "" |
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.
Why is empty string return?
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.
This is a mockup for API, JavaScript does not support keyword escaping for function calls
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 ran with this patch the code that has the problem and got this:
it("testDouble1", function ()
{
let = new fileUnderTest.Na("\n\t\n")
let = .()
(0, )
}
)
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.
Oops, my bad, will be properly fixed soon
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 reopened conversation. Please, see the problem I have
(cherry picked from commit 50f7fa5)
Description
Fixes #1940
How to test
Manual tests
Various scenarios have been tested. You can find the examples in the folder `/utbot-js/samples' and try to run UTBot.
Self-check list