[TS] Evaluate instanceof against the runtime constructor value
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 45/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- kotlin, node.js, typescript
- Lĩnh vực
- compilers, devtools, testing-qa
Hướng nghiên cứu
Start at the current instanceof evaluator and its use of the static EtsIR checkType, then review the focused symbolic-test entry point described in the issue. Account for dependencies JacoDB #390 and UnitTestBot/jacodb#396 before testing. Done means both outcomes share one static RHS type, direct checks remain covered, and generated inputs and results replay in Node.js.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Problem
The current instanceof evaluator uses the static checkType from EtsIR. For a dynamic right-hand side, that type does not identify which constructor object the program actually selected. JacoDB PR #395 therefore marks dynamic checks unsupported instead of reporting a possibly false Boolean.
Minimal TypeScript example
class A {}
class B {}
export function check(useA: boolean): boolean {
const ctor = useA ? A : B;
return new A() instanceof ctor;
}
Node.js returns true for check(true) and false for check(false). The ctor expression must be evaluated once; the membership check must use that runtime value, not its static union type.
Expected support
Use the right-hand constructor value and the left-hand object's prototype chain for the supported class-constructor model. Preserve JavaScript behavior for a non-callable RHS (TypeError) where that value is representable. If custom Symbol.hasInstance is outside the current model, report that case as unsupported explicitly.
Acceptance criteria
- A focused symbolic test obtains both outcomes with the same static RHS type and distinguishes unsupported from failure.
- Generated inputs and results replay in Node.js.
- Direct
value instanceof Aremains covered and correct.
Dependencies: JacoDB #390 (RHS evaluation) and UnitTestBot/jacodb#396 (declared class runtime values). Implement this as a separate USVM PR.
- Ngôn ngữ chính
- Kotlin
- Star
- 33
- Fork
- 27
- Merge trung bình
- 2 ngày 20 giờ
- Pull request đã merge (30 ngày)
- 10
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
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 UnitTestBot/usvm
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
UnitTestBot/usvm#467 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 38/100
UnitTestBot/usvm#465 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
UnitTestBot/usvm#462 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
UnitTestBot/usvm#440 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
UnitTestBot/usvm#439 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của UnitTestBot/usvm
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
nightscout/AndroidAPS#5211 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Place type search does not workĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
commons-app/apps-android-commons#6984 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100