-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Labels
🐛 bugDefect / BugDefect / Bug✅ acceptedThe core team has agreed that it is a good idea to fix thisThe core team has agreed that it is a good idea to fix this
Description
🤔 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
Metadata
Metadata
Assignees
Labels
🐛 bugDefect / BugDefect / Bug✅ acceptedThe core team has agreed that it is a good idea to fix thisThe core team has agreed that it is a good idea to fix this