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

source-academy / js-slang / 35618902861
86%

Build:
DEFAULT BRANCH: master
Ran 21 Sep 2026 03:28PM UTC
Jobs 1
Files 145
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

21 Sep 2026 03:26PM UTC coverage: 84.874% (+0.2%) from 84.684%
35618902861

push

github

web-flow
fix(conductor): run the prelude, and prune the CSE global frame (#2072)

Two fixes to the CSE evaluator, one of them a bug shipped in #2061.

## The prelude was never run

map, filter, accumulate and the rest of the list library are defined in
Source itself (context.prelude), not as native builtins, so they exist
only once the prelude has been evaluated into the context.
runFilesInContext does that for the transpiler evaluator; this evaluator
drives the machine directly and never did it. Every prelude name raised
UndefinedVariableError in the CSE tab — a regression against the legacy
tab, found while working on the pruning below.

The prelude now runs once per evaluator, before the first chunk, and
outside the snapshot stream: the student is stepping through *their*
program, and prepending several hundred steps of library setup would
bury it.

## The global frame showed the entire standard library

js-slang binds every builtin into the global environment's own head, so
that frame arrives with ~40 entries, each rendered with its full source
text, pushing the student's own frame thousands of pixels down the
canvas. The host used to prune it, but
CseMachineLayout.removeUnreferencedGlobalFns early-returns in snapshot
mode — it was written for py-slang, whose global frame is empty.
See source-academy/frontend#4401.

Pruning happens here rather than in the host because the evaluator has
the program's AST, it needs no protocol change, and it keeps those ~40
function bodies out of *every* snapshot instead of filtering them after
they have crossed the channel.

cse/usedGlobals.ts walks the program for names bound in the global or
prelude frames, then closes over the prelude's own use of them — a
program calling map never mentions is_null, but map's body does, and the
student watches it being applied. Prelude functions are Closures with
real ASTs here, so their bodies are walked directly rather than regexed
out of toString() as the host had to.

Deliberately ov... (continued)

2225 of 2722 branches covered (81.74%)

Branch coverage included in aggregate %.

48 of 48 new or added lines in 3 files covered. (100.0%)

4385 of 5066 relevant lines covered (86.56%)

361924.41 hits per line

Jobs
ID Job ID Ran Files Coverage
1 35618902861.1 21 Sep 2026 03:28PM UTC 145
84.87
GitHub Action Run
Source Files on build 35618902861
  • Tree
  • List 145
  • Changed 4
  • Source Changed 0
  • Coverage Changed 4
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • abb42330 on github
  • Prev Build on master (#35618412569)
  • Next Build on master (#35620323934)
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