• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

source-academy / py-slang / 30054803232
86%

Build:
DEFAULT BRANCH: main
Ran 24 Jul 2026 12:16AM UTC
Jobs 1
Files 116
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

23 Jul 2026 11:58PM UTC coverage: 86.159% (+0.02%) from 86.136%
30054803232

push

github

web-flow
Fix Pynter worker crashing on missing node_module/document globals (#343)

@sourceacademy/pynter-wasm's generated glue calls
require("module").createRequire(import.meta.url) unconditionally at
module-load time — only the resulting require's *call* is guarded behind
an ENVIRONMENT_IS_NODE check, not its construction. In the browser IIFE
build this throws immediately when the worker script starts:
Rollup externalizes the Node builtin "module" as a bare global
(`node_module`) that's never defined, and its own import.meta.url
polyfill for IIFE output falls back to `document.baseURI`, which doesn't
exist in a Worker either. Either ReferenceError kills the whole worker
before the conductor's message channels are wired up, so nothing ever
reaches evaluateChunk()'s try/catch or surfaces to the UI — Pynter just
hangs forever with no output and no error, even with #339's separate
wasm-loading fix already deployed (verified live on sourceacademy.org).

Add a banner to the IIFE output defining both missing globals: a
createRequire stub that's safe to construct but never actually called,
and a document.currentScript stand-in pointing at the worker's own URL
(not document.baseURI — a blob: URL can't be used as a relative-resolution
base either, the same class of problem #339 hit).

Verified end-to-end with the real @sourceacademy/conductor host driving
the rebuilt bundle in an actual blob-URL Worker: print(1 + 2) now
completes with the correct output instead of hanging.

Claude-Session: https://claude.ai/code/session_01KrwJGug3rCXijRseRjys9V

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>

4403 of 5500 branches covered (80.05%)

Branch coverage included in aggregate %.

9535 of 10677 relevant lines covered (89.3%)

178594.05 hits per line

Coverage Regressions

Lines Coverage ∆ File
26
85.56
0.41% src/engines/py2js/runtime.ts
25
87.07
0.04% src/resolver/resolver.ts
2
91.3
0.4% src/conductor/Py2JsEvaluator.ts
2
85.45
0.55% src/engines/py2js/index.ts
Jobs
ID Job ID Ran Files Coverage
1 30054803232.1 24 Jul 2026 12:16AM UTC 116
86.16
GitHub Action Run
Source Files on build 30054803232
  • Tree
  • List 116
  • Changed 4
  • Source Changed 4
  • Coverage Changed 4
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #30054803232
  • 86f4090d on github
  • Prev Build on main (#30009329634)
  • Next Build on main (#30065565222)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc