new Function interpreter: with statement unsupported (breaks lodash _.template defaults)
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 46/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- rust, typescript
Línea de trabajo
Start with the runtime interpreter for new Function bodies introduced in #6559 and trace how it parses and handles statement constructs. Reproduce the supplied with (obj) example and compare it with the working literal body. Done means the runtime-built example prints 42, while the reported lodash template case no longer fails.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
The runtime interpreter for new Function / Function(...) bodies (#6559) rejects with statements:
const body = ["with (obj) {", " return a + 1;", "}"].join(process.argv.length > 99 ? "x" : "\n");
console.log(Function("obj", body)({ a: 41 }));
- Node: prints
42 - Perry (
ced22982):TypeError: perry runtime interpreter (new Function, #6559): unsupported construct: with statement
A literal body compiled ahead of time works; only runtime-built bodies hit the interpreter.
Impact: lodash's _.template with default options (no variable setting) builds its render function as Function(... "with (obj) { ... }" ...), so it fails in lodash compiled from source. With { variable: 'd' }, which generates no with, it works. Other template engines that use the same with pattern (underscore templates, ejs without _with: false) would hit this too.
Found while probing removal of the native lodash shim.
- Lenguaje dominante
- Rust
- Estrellas
- 4.9k
- Forks
- 166
- Merge medio
- 3 h 46 min
- PR fusionados (30 d)
- 891
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Tiene una 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 PerryTS/perry
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
Los mantenedores suelen responder en 1 día
-
package-audit performance
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
PerryTS/perry#13976 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
bug package-audit performance
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
PerryTS/perry#13974 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
bug package-audit
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
Los mantenedores suelen responder en 1 día
-
bug package-audit
Dificultad 4/5 3-5 días Aptitud para principiantes 53/100
Los mantenedores suelen responder en 1 día
Todos los issues de PerryTS/perry
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
madesroches/fontaine#513 ·
Los mantenedores suelen responder en 1 día
-
area:ui needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
bherbruck/solvecraft#13497 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
needs-triage tooling
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
neilsh/stunt-reel#317 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
storytold/craft-fonts#65 ·
Los mantenedores suelen responder en 2 días