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

[Bug]: Unexpected string replacement in JS Object #38330

Open
1 task done
phantom943 opened this issue Dec 23, 2024 · 0 comments
Open
1 task done

[Bug]: Unexpected string replacement in JS Object #38330

phantom943 opened this issue Dec 23, 2024 · 0 comments
Assignees
Labels
Bug Something isn't working Community Reported issues reported by community members Medium Issues that frustrate users due to poor UX Needs Triaging Needs attention from maintainers to triage Production

Comments

@phantom943
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Description

Exact this. string inside a JS Object gets replaced with the object name and a dot. This is expected inside of the function body, but not inside a string where the literal value with no interpolation/replacement is expected.
Known workaround: Assign literal this string to a variable, and then do manual interpolation.

const q = 'this';
const quote = `I hate ${q}.`;

Steps To Reproduce

  1. Create new project
  2. Create a JS function
  3. Paste the following snippet into the object's body:
    export default {
        async fun() {
            const quote = "I hate this.";
            showAlert(quote);
        }
    }
  4. Run function by pressing the "Run" button
  5. Note that in the output 'I hate JSObject1.' is being printed instead of 'I hate this.'

Public Sample App

https://app.appsmith.com/app/my-first-application/page1-676983a8bdaced79172b1751

Environment

Production

Severity

Medium (Frustrating UX)

Issue video log

No response

Version

Cloud

@phantom943 phantom943 added Bug Something isn't working Needs Triaging Needs attention from maintainers to triage labels Dec 23, 2024
@Nikhil-Nandagopal Nikhil-Nandagopal added Community Reported issues reported by community members Medium Issues that frustrate users due to poor UX Production labels Dec 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Community Reported issues reported by community members Medium Issues that frustrate users due to poor UX Needs Triaging Needs attention from maintainers to triage Production
Projects
None yet
Development

No branches or pull requests

3 participants