appsmithorg / appsmith

Platform to build admin panels, internal tools, and dashboards. Integrates with 25+ databases and any API.
https://www.appsmith.com
Apache License 2.0
33.83k stars 3.65k forks source link

[Bug]: JSEditor doesn't support recursive functions #9806

Open Nikhil-Nandagopal opened 2 years ago

Nikhil-Nandagopal commented 2 years ago

Is there an existing issue for this?

Current Behavior

A user reported that they got a cyclic dependency while creating a recursive function in the JS Editor

Steps To Reproduce

  1. Create a JS Object
  2. Create a function and try to recursively invoke it.
  3. See a cyclic dependency

Environment

Production

Version

Cloud

rishabhrathod01 commented 2 years ago

Workaround for this, if user needs a function to recursively run would be.

export default {
    myFunc: () => {
       const recusrsiveFunc = (obj) => {
             const value = obj;
             return value;
       };
      recusrsiveFunc(obj);
   }
}