Discarded negation of a void call rejects valid JavaScript
Maintainer thường phản hồi trong vòng 1 ngà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
- 1/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- javascript, typescript
- Lĩnh vực
- compilers
Hướng nghiên cứu
Start by locating the diagnostic that reports SC0001 for discarded negation of a void call, then trace how expression statements are lowered and compare them with consumed negations. Check the compiler tests for void expressions and add coverage for both !register() and an immediately invoked function expression, while preserving type-checking diagnostics. Done means discarded negation statements compile with their side effects intact, while consumed negations still require a runtime value; the issue notes that separate late-var require() restrictions remain.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
When compiling a bundled CLI, the generated debug-ID banner starts an immediately invoked function with !. Its boolean result is discarded. Node runs the banner, but scriptc rejects it before lowering because the function returns void.
This also reproduces without the bundle:
function register() {
console.log("registered");
}
!register();
Node prints registered and exits successfully. Current scriptc 0.4.9 reports SC0001: An expression of type 'void' cannot be tested for truthiness. The same problem affects !function () { console.log("registered"); }();.
For an expression statement, the result of the negation is unused. Evaluating the operand once and discarding its result preserves the side effects and any exception. The boolean conversion itself does not call user code.
This report is limited to discarded negation statements. A consumed negation, an if condition, or a short-circuit operand still needs a runtime value. Treating every void value as undefined would be unsafe: a callback typed as returning void can return a value at runtime. TypeScript and JavaScript projects that explicitly request type checking should retain their diagnostics.
In the current CLI application entry, five of seven diagnostic sites are this discarded-banner pattern. Removing that refusal exposes two separate late-var require() restrictions; it does not make the full CLI compile yet.
- Ngôn ngữ chính
- TypeScript
- Star
- 6.5k
- Fork
- 212
- Merge trung bình
- 13 giờ 2 phút
- Pull request đã merge (30 ngày)
- 798
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc 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 vercel-labs/scriptc
-
Optional JSDoc rejects mandatory JavaScript setter parametersCó thể đã có người làm @MathurAditya724 đã nhận hôm nay. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
vercel-labs/scriptc#3355 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Correct JavaScript refusal descriptions for mutable bindings and missing propertiesCó thể đã có người làm @MathurAditya724 đã nhận hôm nay. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 25/100
vercel-labs/scriptc#3354 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
vercel-labs/scriptc#3330 ·
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 25/100
vercel-labs/scriptc#3210 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Abstract methods block coverage and direct calls when no subclass existsCó thể đã có người làm @alantriesagain đã nhận 2 ngày trước. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
vercel-labs/scriptc#3077 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của vercel-labs/scriptc
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
microsoft/vscode-containers#655 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
dsh-tauri-desk/deepseek-harness-desktop#1477 · 1 bình luận ·
-
[docs] RELEASE.md: wrong branch name, no check that the prepare PR merged with the right subject, manual publish stepCó thể đã có người làm @albertteoh đã nhận hôm nay. Đang mởdocumentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
jaegertracing/jaeger-ui#4739 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Add: Shop On TV SDĐang mởcheck:passed streams:add
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
Maintainer thường phản hồi trong vòng 1 ngày