andreypopp/autobind-decorator

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

Open

#76 geöffnet am 16. Nov. 2018

Auf GitHub ansehen
 (8 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)JavaScript (1.446 Stars) (76 Forks)batch import
PR welcomebughelp wanted

Beschreibung

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

Contributor Guide