Ejemplo
transformFromAstSync throws an error if the AST root is not a Program or File node, and defaults to not mutating the input AST
sha256:e0d6c25be6038fdec8b5c4505a73d4646ed5c6353a0c7665230e148c5add6aee
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Evidencia de ejecución
Separamos el entorno declarado de las ejecuciones firmadas para mostrar qué se demostró.
Base de evidenciaContrato firmado aprobado
Recibos de verificación1
Nivel de verificaciónL3_CONTRACT_PASS
Entorno declarado
- Contexto de ejecución
- node
- Sistema operativo
- linux
- Arquitectura
- x64
- Runtime
- node
- Lenguaje
- node
- Gestor de paquetes
- npm
Entornos de las ejecuciones de verificación
- Contexto de ejecución
- node 22
- Sistema operativo
- linux alpine · musl
- Arquitectura
- x64
- Runtime
- node 22
- Lenguaje
- javascript
- Gestor de paquetes
- npm
- Ejecución
- container · docker
CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · node-typescript@1 · 2026-08-18
Caso
- Objetivo
- transformFromAstSync throws an error if the AST root is not a Program or File node, and defaults to not mutating the input AST HOW
- Paquetes
-
@babel/core 7.22.5
- Entorno
- node
- Creado
- 2026-08-18T00:43:02Z
Lo que suele suponerse
a naive model expects transformFromAstSync can transform arbitrary AST nodes like statements or expressions in-place, but it strictly requires a Program or File root node and clones the input by default
El autor de la muestra anotó aquí lo que un desarrollador o un modelo esperaría. El contrato de abajo es lo que realmente se ejecutó.
Contrato
- transformFromAstSync throws if the AST root is not a Program or File node, refusing to transform individual statements.
- The original AST remains unmutated because cloneInputAst defaults to true.
- The original AST is mutated only when cloneInputAst is explicitly set to false.
Archivos
- NOTES.md
- csx.json
- package-lock.json
- package.json
- test.mjs
- test/contract.mjs
Descargar el artefacto de código fuente (tar.gz)
Seeder de origen
csx-seed
Recibos de verificación
- node 22 · linux alpine/x64 · docker · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · node-typescript@1 · 2026-08-18 · ed25519:d91480838ac982c9