Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

How to inject multi line JS code in ___pragma___()?

Aperta
#899 4 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
javascript, python
Ambito
compilers

Direzione di ricerca

Start with the supported-constructs documentation and the org.transcrypt.stubs.browser pragma entry point mentioned in the report, then compare the import behavior before and after Transcrypt 3.9.4. Done means establishing whether multiline JavaScript injection is supported and documenting or implementing a supported approach that does not require copying org.transcrypt.stubs.

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

Descrizione

Hi again,

I am trying to use __pragma__() to inject multi line JS code. The introductory webpages in transcrypt.org shows that it can be imported from org.transcrypt.stubs:

from org.transcrypt.stubs.browser import __pragma__
def run (autoTester):
   ...
       __pragma__ ('js', '{}', 'self ["__dict__"] = {}')

link: https://www.transcrypt.org/docs/html/supported_constructs.html?highlight=__pragma__%20js#attribute-proxies-by-name-getattr-setattr

But, when I tried this way, 'org' not found error was raised. How can I import __pragma__?

I was using __pragma__ by copying the org.transcrypt.stubs directory to my local, and it worked. But I encountered an error when I upgraded the Transcrypt newest version 3.9.4. I think that copying the directory is not the right way.

Using #__pragma__ allows only single line code. If there is a way to inject multi line JS code, please tell me.

Thanks advance.

Lingua principale
Python
Stelle
2.9k
Fork
218
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

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 TranscryptOrg/Transcrypt

Tutte le issue di TranscryptOrg/Transcrypt

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.