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

qunitjs / qunit / 9803176541
90%

Build:
DEFAULT BRANCH: main
Ran 05 Jul 2024 04:41AM UTC
Jobs 1
Files 37
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

05 Jul 2024 04:40AM UTC coverage: 88.938% (+0.006%) from 88.932%
9803176541

push

github

web-flow
Core: Fix missing second frame in QUnit.stack() in Safari

Safari implements ES6 Tail-Call Optimization, which is when:
- the file is in strict mode,
- and, in a regular function (not async or generator),
- and, the return statement ends in a simple function call.

Then, the current function is removed from the stack before the
child function begins. TCO applies even for calls that are not
recursive.

The result is that, given:

> makeFakeFailure -> exampleMain -> exampleParent -> exampleCurrent ->
> QUnit.stack -> sourceFromStacktrace -> new Error.

In Firefox and Chrome, `e.stack` is:

```
[0] sourceFromStacktrace (SLICED)
[1] QUnit.stack          (SLICED)
[2] exampleCurrent
[3] exampleParent
[4] exampleMain
[5] makeFakeFailure
```

But, in Safari, the second frame gets lost because our tiny
`QUnit.stack()` function is a candidate for Tail-Call Optimization.

```
[0] sourceFromStacktrace (SLICED)
[1] exampleCurrent       (SLICED)
[2] exampleParent
[3] exampleMain
[4] makeFakeFailure
```

This, combined with the fact that we strip the first two frames as
a way to hide internal offsets, meant that in Safari we ended up
attributing failed assertions and test definitions to the parent of
the caller rather than the actual caller, e.g. exampleParent() instead
of exampleCurrent.

Ref https://bugs.webkit.org/show_bug.cgi?id=276187.
Closes https://github.com/qunitjs/qunit/pull/1776.

2 of 2 new or added lines in 1 file covered. (100.0%)

1825 of 2052 relevant lines covered (88.94%)

2140.6 hits per line

Jobs
ID Job ID Ran Files Coverage
1 9803176541.1 11 Jul 56479 04:32PM UTC 0
88.94
GitHub Action Run
Source Files on build 9803176541
Detailed source file information is not available for this build.
  • Back to Repo
  • 52f37b8f on github
  • Prev Build on main (#9802704899)
  • Next Build on main (#9822612258)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc