Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Merged
rudolf101 merged 2 commits into main from sergeyl/js-false-escaping-fix
Mar 15, 2023
Merged

Conversation

Copy link
Member

@rudolf101 rudolf101 commented Mar 14, 2023
edited
Loading

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

  • I've set the proper labels for my PR (at least, for category and component).
  • PR title and description are clear and intelligible.
  • I've added enough comments to my code, particularly in hard-to-understand areas.
  • The functionality I've repaired, changed or added is covered with automated tests.
  • Manual tests have been provided optionally.
  • The documentation for the functionality I've been working on is up-to-date.

@rudolf101 rudolf101 added comp-codegen Issue is related to code generator lang-javascript Issue is related to JavaScript support ctg-bug-fix PR is fixing a bug labels Mar 14, 2023
@rudolf101 rudolf101 changed the title (削除) Fixed false naming escaping in JavaScript (削除ここまで) (追記) Fix false naming escaping in JavaScript (追記ここまで) Mar 14, 2023

override fun escapeNamePossibleKeywordImpl(s: String): String =
if (isLanguageKeyword(s, context.cgLanguageAssistant)) "`$s`" else s
override fun escapeNamePossibleKeywordImpl(s: String): String = ""
Copy link
Collaborator

@Markoutte Markoutte Mar 15, 2023

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?

Copy link
Member Author

@rudolf101 rudolf101 Mar 15, 2023

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

Copy link
Collaborator

@Markoutte Markoutte Mar 15, 2023

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, )
}
)

Copy link
Collaborator

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

Copy link
Collaborator

@Markoutte Markoutte left a 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

rudolf101 reacted with eyes emoji
@rudolf101 rudolf101 merged commit 50f7fa5 into main Mar 15, 2023
@rudolf101 rudolf101 deleted the sergeyl/js-false-escaping-fix branch March 15, 2023 15:03
denis-fokin pushed a commit that referenced this pull request Mar 16, 2023
@alisevych alisevych added this to the 2023.03 Release milestone Mar 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers

@zishkaz zishkaz zishkaz left review comments

@Markoutte Markoutte Markoutte approved these changes

Labels
comp-codegen Issue is related to code generator ctg-bug-fix PR is fixing a bug lang-javascript Issue is related to JavaScript support
Projects
None yet
Development

Successfully merging this pull request may close these issues.

JS. Function call has extra apostrophes

AltStyle によって変換されたページ (->オリジナル) /