Discarded negation of a void call rejects valid JavaScript
Los mantenedores suelen responder en 1 día
@MathurAditya724 ya está trabajando en esto.
Desde el 7/11/2026.
- #3362 de @MathurAditya724 — abierto
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 1/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Estancado
- Stack tecnológico
- javascript, typescript
- Área
- compilers
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- TypeScript
- Estrellas
- 6.5k
- Forks
- 212
- Merge medio
- 13 h 2 min
- PR fusionados (30 d)
- 798
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de vercel-labs/scriptc
-
Optional JSDoc rejects mandatory JavaScript setter parametersPosiblemente ocupada @MathurAditya724 la tomó hoy. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
vercel-labs/scriptc#3355 ·
Los mantenedores suelen responder en 1 día
-
Correct JavaScript refusal descriptions for mutable bindings and missing propertiesPosiblemente ocupada @MathurAditya724 la tomó hoy. Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 25/100
vercel-labs/scriptc#3354 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
vercel-labs/scriptc#3330 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
vercel-labs/scriptc#3210 ·
Los mantenedores suelen responder en 1 día
-
Abstract methods block coverage and direct calls when no subclass existsPosiblemente ocupada @alantriesagain la tomó hace 2 días. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
vercel-labs/scriptc#3077 ·
Los mantenedores suelen responder en 1 día
Todos los issues de vercel-labs/scriptc
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
microsoft/vscode-containers#655 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
dsh-tauri-desk/deepseek-harness-desktop#1477 · 1 comentario ·
-
[docs] RELEASE.md: wrong branch name, no check that the prepare PR merged with the right subject, manual publish stepPosiblemente ocupada @albertteoh la tomó hoy. Abiertodocumentation
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
jaegertracing/jaeger-ui#4739 ·
Los mantenedores suelen responder en 1 día
-
Add: Shop On TV SDAbiertocheck:passed streams:add
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
Los mantenedores suelen responder en 1 día