[Decorators] Missing error when calling `addInitializer` after that the decorator is done
@rbuckton đang làm issue này rồi.
Từ ngày 5/2/2024.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
🔎 Search Terms
decorators addInitializer error
🕗 Version & Regression Information
- This is the behavior in every version I tried since Stage 3 decorators where implemented
⏯ Playground Link
💻 Code
let addInitializerFrom1: DecoratorContext["addInitializer"];
function dec1(_: any, ctx: DecoratorContext) {
addInitializerFrom1 = ctx.addInitializer;
}
function dec2(_: any, _2: any) {
addInitializerFrom1(() => {})
console.log("ADDED")
}
class A {
@dec2
@dec1
foo = 1;
}
🙁 Actual behavior
The addInitializerFrom1 call should throw
🙂 Expected behavior
addInitializerFrom1 doesn't throw
Additional information about the issue
After that dec1 is called, decorationState.[[Finished]] for the decorationState relative to dec1 is set to false and thus calling addInitializer should throw.
- Ngôn ngữ chính
- Go
- Star
- 111k
- Fork
- 14.4k
- Merge trung bình
- 1 ngày 19 giờ
- Pull request đã merge (30 ngày)
- 117
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của microsoft/TypeScript
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
microsoft/TypeScript#64322 · 2 bình luận · 1 reaction · 2 người được giao ·
-
Possible Improvement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
microsoft/TypeScript#64278 · 1 bình luận · 1 reaction ·
-
Docs
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
microsoft/TypeScript#64118 · 1 bình luận ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
microsoft/TypeScript#64094 ·
-
Docs
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
microsoft/TypeScript#63959 · 5 bình luận ·
Tất cả issue của microsoft/TypeScript
Issue tương tự
-
kind/bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
kubernetes-sigs/prow#953 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
caddyserver/caddy#8046 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
-
L1 recommended for recruits
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
-
area/entangle bug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100