andreypopp/autobind-decorator

If bound methods or fields are re-assigned, they become shared between instances

Open

#76 创建于 2018年11月16日

在 GitHub 查看
 (8 评论) (0 反应) (0 负责人)JavaScript (1,446 star) (76 fork)batch import
PR welcomebughelp wanted

描述

If bound methods or fields are re-assigned, they become shared between instances

Found this issue while trying to debounce bound method

Below test will fail

class A {
  @boundMethod
  bound() {}
}

const a = new A();
const b = new A();
a.bound = {
  foo: 'bar'
};
assert.notEqual(a.bound, b.bound);

贡献者指南