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

source-academy / py-slang / 30958381688
86%

Build:
DEFAULT BRANCH: main
Ran 04 Aug 2026 11:17PM UTC
Jobs 1
Files 137
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

04 Aug 2026 10:58PM UTC coverage: 86.108% (+0.08%) from 86.027%
30958381688

push

github

web-flow
py2js: stop showing a fabricated line number, name the enclosing predefined function (#399)

* py2js: stop showing a fabricated line number, name the enclosing predefined function (#397)

py2js's bridged stdlib builtins (tail, head, math_sqrt, ...) raise using
a synthetic call-site token with no real source position (stdlibBridge.ts's
syntheticCallNode is hardcoded to line 1). errors.ts's TypeError/ValueError
unconditionally printed "at line X" and a code-frame snippet computed from
that fake position, which was actively misleading rather than just
imprecise — reported line depended on unrelated things like how many blank
lines preceded the call. Both classes now check the token's existing
`synthetic` flag and skip the location header entirely when it's set.

Since a real position isn't available, the next best thing is naming which
predefined (prelude) function the failing builtin was called from — e.g.
tail() failing partway through map()'s own internal _map helper now says
"in predefined function 'map'" rather than leaving the student to guess
why the object of a call they never wrote showed up in the error. This
required a small addition to Py2JsRuntime: every function is tagged
pyPrelude (compiled from a stdlib group's own prelude source) or pyNative
(a bridged/native builtin) at creation, and call()/acall() track, per
currently-executing frame, which predefined function (if any) it's
logically nested inside of — deliberately left untouched across a
tail-call bounce, since TCO means "the same logical frame, a different
function now running in it," and reset to nothing the moment a genuine
user-defined function is on the stack, so an error inside a user's own
callback is never misattributed to library code that merely invoked it.

Fixes #397.

* Add regression test: math_sqrt(-1) no longer crashes with a raw RangeError

Pre-existing on main, unrelated to #398: ValueError's location header
did " ".repeat(offset), and offset is -1 whenever fullLine.... (continued)

4684 of 5861 branches covered (79.92%)

Branch coverage included in aggregate %.

97 of 102 new or added lines in 4 files covered. (95.1%)

1 existing line in 1 file now uncovered.

10452 of 11717 relevant lines covered (89.2%)

166487.14 hits per line

Uncovered Changes

Lines Coverage ∆ File
2
86.71
0.62% src/engines/py2js/runtime.ts
2
74.62
1.17% src/errors/errors.ts
1
85.84
2.13% src/engines/py2js/index.ts

Coverage Regressions

Lines Coverage ∆ File
1
74.62
1.17% src/errors/errors.ts
Jobs
ID Job ID Ran Files Coverage
1 30958381688.1 04 Aug 2026 11:17PM UTC 137
86.11
GitHub Action Run
Source Files on build 30958381688
  • Tree
  • List 137
  • 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 #30958381688
  • 84cc9353 on github
  • Prev Build on main (#30888267603)
  • Next Build on main (#30992841357)
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