developit / developit/decko

@bind decorator bug when super method is called

Đang mở
#12 5 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
JavaScript
Star
1k
Fork
34
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

This snippet demonstrates that the `bind` decorator does not work correctly on second method call if that method invokes super method which in turn is also decorated:
```javascript
class A {
@bind
f() {
console.log('I\'m A.f');
}
}

class B extends A {
@bind
f() {
console.log('I\'m B.f BEGIN');
super.f();
console.log('I\'m B.f END');
}
}

let b = new B();
console.log('call b.f() 1st time:');
b.f();
console.log('call b.f() 2nd time:');
b.f();
```
Output:
```
call b.f() 1st time:
I'm B.f BEGIN
I'm A.f
I'm B.f END
call b.f() 2nd time:
I'm A.f
```

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.