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

Stack overflow on option that depends on itself #102

Open
PhilLavoie opened this issue Sep 23, 2020 · 1 comment
Open

Stack overflow on option that depends on itself #102

PhilLavoie opened this issue Sep 23, 2020 · 1 comment

Comments

@PhilLavoie
Copy link

const Factory = require("rosie").Factory;
const myFactory = new Factory().option(
  "wantThat",
  ["wantThat"],
  (wantThat) => {
    if (wantThat == null) {
      return "want it anyway";
    }
    return wantThat;
  }
);
myFactory.build(); // Stack overflow

It works with an attribute, however. The documentation doesn't warn against that case, which makes me think it's an unintended behaviour.

@eventualbuddha
Copy link
Contributor

You're right. This probably is not the right behavior. I'd review a PR that fixes it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants