andreypopp/autobind-decorator

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

オープン

#76 opened on 2018/11/16

 (8 件のコメント) (0 件のリアクション) (0 人の担当者)JavaScript (76 件のフォーク)batch import
PR welcomebughelp wanted

Repository metrics

Stars
 (1,446 個のスター)
PR merge metrics
 (30d に merged 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);

コントリビューターガイド