Skip to content
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

An exclamation mark operator (!) produces an error in async expressions #7268

Closed
mgoetz-nerdery opened this issue Oct 31, 2023 · 3 comments
Closed
Assignees
Labels
bug user issue An issue or bug reported by users
Milestone

Comments

@mgoetz-nerdery
Copy link

Are you requesting a feature, reporting a bug or asking a question?

Reporting a bug

What is the current behavior?

When using the ! operator on an async expression, the page errors out with "this.returnResult is not a function."
Screenshot 2023-10-31 at 8 56 42 AM

What is the expected behavior?

The page should not error out, and should work as expected.

How would you reproduce the current behavior (if this is a bug)?

  1. Create a custom function that returns a value (using this.returnResult)
  2. Register it to FunctionFactory as an async function (third parameter set to true)
  3. Use this function in an expression such as visibleIf, and use the ! operator to negate it.
  4. Observe the failure.

Provide the test code and the tested page URL (if applicable)

Tested page URL: https://codesandbox.io/s/brave-heyrovsky-3rzmnc?file=/src/SurveyComponent.jsx

Specify your

  • browser: Google Chrome
  • browser version: 117
  • surveyjs platform (angular or react or jquery or knockout or vue): React
  • surveyjs version: 1.9.114
@JaneSjs
Copy link
Contributor

JaneSjs commented Oct 31, 2023

Hello @mgoetz-nerdery,

Thank you for sharing a demo. From what I gather, you placed an exclamation mark before your custom function to invert the custom function's result.

We will investigate this issue and provide you with an update shortly.

@JaneSjs JaneSjs added bug user issue An issue or bug reported by users labels Oct 31, 2023
@mgoetz-nerdery
Copy link
Author

Yep, that's correct! It works fine if I don't use the exclamation point, but when I do use the exclamation point to negate the result of the expression, that's when I see the error.

@andrewtelnov andrewtelnov self-assigned this Oct 31, 2023
andrewtelnov added a commit that referenced this issue Oct 31, 2023
@tsv2013 tsv2013 closed this as completed in f384178 Nov 1, 2023
@RomanTsukanov RomanTsukanov changed the title ! operator with async expressions causes error An exclamation mark operator (!) produces an error in async expressions Nov 1, 2023
@mgoetz-nerdery
Copy link
Author

Confirmed that this is resolved in my test case when I update to 1.9.115. Thanks for the fast turnaround!

@JaneSjs JaneSjs added this to the v1.9.115 milestone Nov 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug user issue An issue or bug reported by users
Projects
None yet
Development

No branches or pull requests

3 participants