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 (76 fork)batch import
PR welcomebughelp wanted

倉庫指標

Star
 (1,446 star)
PR 合併指標
 (30 天內沒有已合併 PR)

描述

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);

貢獻者指南