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

justjs / just / 116 / 1
97%
master: 97%

Build:
DEFAULT BRANCH: master
Ran 18 Jun 2020 11:24AM UTC
Files 43
Run time 5s
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

17 Jun 2020 07:08AM UTC coverage: 96.987% (+0.03%) from 96.956%
116.1

push

travis-ci

AlexisPuga
BUG: Fix. Global is not being defined if a similar script is loading it

This bug appears to be consistent on webkit browsers. Neither JSDOM nor
mozilla seem to be affected.
Basically, if an <script> contains a global and you load it via html,
the first time you visit your website, it won't define that global
in just.Define.

The steps to reproduce this bug are the following:
- Create a file called index.html and put the following on it (remember to
change the path of the justjs file):
<html>
<head>
    <title>Bug</title>
</head>
<body>
    <script
        src='/path/to/just.js'
        data-just-Define='{"index": "index.js"}'
        async/></script>
    <script
        src='bug.js'
        data-just-Define='{"bug": "[src]"}'
        async></script>
</body>
</html>
- Create a file called "bug.js" and put "window.someGlobal = 1;" on it.
- Create another file called "index.js" and put the following on it:
  if ('someGlobal' in window) { just.Define('someGlobal', window.someGlobal); }
  else { just.Define.globals['someGlobal'] = function () { return
window.someGlobal; }; }
just.Define(['someGlobal'], function (someGlobal) { console.log(someGlobal); });
- Open index.html using a webkit browser.
- Open the console and reload the page (clear the cache if necessary).

After these steps, the console should log 1.

In order to fix this:

Add the same listener (as the created element) to similar element
and remove it when done. Client should define a global the right way, though.

337 of 363 branches covered (92.84%)

Branch coverage included in aggregate %.

500 of 500 relevant lines covered (100.0%)

51.71 hits per line

Source Files on job 116.1
  • Tree
  • List 0
  • Changed 4
  • Source Changed 2
  • Coverage Changed 4
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Build 52
  • Travis Job 116.1
  • 3a195421 on github
  • Prev Job for on master (#115.1)
  • Next Job for on master (#117.1)
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