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

Decoration is bound to the wrong this-ref in v3.30.0 #920

Open
lilsweetcaligula opened this issue May 22, 2023 · 0 comments
Open

Decoration is bound to the wrong this-ref in v3.30.0 #920

lilsweetcaligula opened this issue May 22, 2023 · 0 comments

Comments

@lilsweetcaligula
Copy link
Contributor

lilsweetcaligula commented May 22, 2023

const Seneca = require('..')

const si = Seneca()

si.decorate('lorem', function (self) {
  console.log(this === self)
})

si.add('hello:world', function (args, reply) {
  const delegate = this.delegate()

  // logs true (as expected) in master (p4.0.0-t.1.p.1)
  // logs false (incorrect) in v3.30.0
  delegate.lorem(delegate)

  reply()
})

si.ready(() => {
  si.act('hello:world', () => {})
})
@lilsweetcaligula lilsweetcaligula changed the title Decoratee is bound to the wrong this-ref in v3.30.0 Decoration is bound to the wrong this-ref in v3.30.0 May 22, 2023
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