Add full-output transpile tests for classes inside #if blocks

Aperta
#1,900 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
77/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
typescript
Ambito
testing

Direzione di ricerca

Start with the existing class transpile tests and the testTranspile helper; the issue points to review discussion #1886 for context. Add full-output cases for each listed conditional-compilation scenario, including both values of DEBUG. Done when the expected output confirms each class's builder, methods, and factory stay in the correct branch.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

transpiler

Follow-up from a review comment on #1886: https://github.com/rokucommunity/brighterscript/pull/1886#discussion_r4207133338

A class transpiles to several functions: __Foo_builder, one __Foo_method_* per method, and the function Foo() factory. When the class is inside an #if / #else block, all of them must be emitted inside that same branch. Otherwise the device compiles a factory without its methods, or methods for a class it never declares.

The existing tests only check substrings of the output. Add full-output transpile tests (testTranspile) that cover:

  • a class with methods inside #if DEBUG, with and without DEBUG declared
  • the same class name declared in both #if and #else with different members
  • a child class extending a parent, both inside the same #if
  • an active class and an inactive class in the same file
Lingua principale
TypeScript
Stelle
212
Fork
72
Merge medio
3g 2h
PR unite (30g)
64

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di rokucommunity/brighterscript

Tutte le issue di rokucommunity/brighterscript

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.