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

justjs / just / 116
97%

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

pending completion
116

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

Jobs
ID Job ID Ran Files Coverage
1 116.1 18 Jun 2020 11:24AM UTC 0
96.99
Travis Job 116.1
Source Files on build 116
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #116
  • 3a195421 on github
  • Prev Build on master (#115)
  • Next Build on master (#117)
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