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

The imported world-Proxy should also work in the transformer method for defineParameterType #2447

Open
htho opened this issue Nov 27, 2024 · 0 comments

Comments

@htho
Copy link

htho commented Nov 27, 2024

🤔 What's the problem you're trying to solve?

I want to access the world within a transformer arrow-function when I defineParameterType.
But this fails with: Error: Attempted to access 'world' from incorrect scope; only applicable to steps and case-level hooks

defineParameterType({
  name: 'person',
  regexp: /Lucy|Sean/,
  transformer: function (name){
    console.log("########################", this, this.attach); // OK
    console.log("########################", world, world.attach); // FAILS
    return new Person(name);
  }
})

✨ What's your proposed solution?

This should be possible, because I can access the World through this in a normal function.

⛏ Have you considered any alternatives or workarounds?

I can use a function instead of an arrow function and use this instead of world.

📚 Any additional context?

No response

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

1 participant