Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

Load script as module

Offen
#353 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
45/100
Issue-Typ
Feature
Klarheit
Größtenteils klar
Aktivitätsstatus
Veraltet
Tech-Stack
javascript, ruby
Bereich
backend

Rechercherichtung

Start by reading the MiniRacer::Context#eval entry point and how it passes JavaScript source to V8; the issue does not name files or tests. Check how V8 supports compiling and running modules, then determine how module loading should fit the existing context API. Done means mini_racer can load module code and accept top-level await; add coverage for that behavior.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

mini_racer 0.18.1
libv8-node 23.6.1.0
Ruby 3.4.2

JavaScript modules are different than classic scripts in a few ways. As an example, in a module, you can do a top-level await, but in a classic script, you can't.

> require 'mini_racer'
=> false
> context = MiniRacer::Context.new(timeout: 500, max_memory: 20_000_000)
=> #<MiniRacer::Context:0x00007f11ecd95148>
> context.eval('await Promise.resolve(console.log("🎉"));')
:3:in 'MiniRacer::Context#eval': Uncaught SyntaxError: await is only valid in async functions and the top level bodies of modules at <eval>:1:0 (MiniRacer::ParseError)
        from :3:in '<main>'

I would like to be able to load code as a module with mini_racer.

Vorherrschende Sprache
JavaScript
Sterne
628
Forks
100
Ø Merge
1 T. 20 Std.
Gemergte PRs (30 T.)
2

Entwicklungsumgebung

  • Enthält ein Dockerfile oder eine Docker-Compose-Datei
  • Keine Pull-Request-Vorlage
  • Kein Beitragsleitfaden

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus rubyjs/mini_racer

Alle Issues in rubyjs/mini_racer

Ähnliche Issues

Weitere Issues zu JavaScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.