[TS] Bind lexical this when calling stored arrow functions
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
- 48/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- kotlin, typescript
- Lĩnh vực
- compilers, testing-qa
Hướng nghiên cứu
Start with TsExprResolver.kt at the function-reference creation and indirect call resolution locations cited in the issue, and review the EtsIR dependency in UnitTestBot/jacodb#391. Replay lexicalThis through USVM and compare it with the TypeScript/Node.js result. Done means stored arrows return 12, ordinary stored functions retain dynamic receivers, and a focused test records both results.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Problem
A stored arrow function is called with the receiver of the property access instead of the this captured where the arrow was created. This is independent of the object-array symbolic-input problem that remains in #419.
Minimal TypeScript example
class Box {
callback!: (value: number) => number;
constructor(public offset: number) {}
installOn(target: Box): void {
target.callback = (value: number) => this.offset + value;
}
call(value: number): number {
return this.callback(value);
}
}
export function lexicalThis(): number {
const source = new Box(11);
const target = new Box(100);
source.installOn(target);
return target.call(1);
}
lexicalThis() returns 12 in TypeScript/Node.js. The related StoredFunctionCall test reported in #419 on the #418 head returned 101 in USVM, using the target receiver instead of the source receiver. This standalone snippet has not yet been replayed through USVM.
Dependency and source evidence
- UnitTestBot/jacodb#391 tracks preserving the arrow/function distinction and lexical receiver in EtsIR. This issue owns the USVM call binding after that representation is available.
- Function-reference creation constructs the reference from the lifted method and closure environment.
- Indirect call resolution uses
callee.thisInstancefor the call.
The source links are pinned to USVM main 53dce8f3. The related failure was observed on the #418 head; it is not claimed as a fresh main-branch replay.
Acceptance criteria
- A stored arrow retains its lexical
thiswhen assigned to and called through another object; the example returns12. - An ordinary stored function expression still uses its dynamic call receiver.
- A focused test checks the USVM result and confirms a concrete TypeScript/Node.js replay.
- 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 45/100
UnitTestBot/usvm#457 ·
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ự
-
feat: 工作区文件菜单增加「复制文件路径」选项Đang mởenhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
good first issue help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
bug 🐞 Untriaged user issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
valkey-io/valkey-glide#7306 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Bookmarking an article that is already bookmarked under its redirect URL deletes both bookmarksCó thể đã có người làm @aakarshitv đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
kiwix/kiwix-android#5176 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug good first issue
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 77/100
open-telemetry/opentelemetry-kotlin#1202 · 1 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày