Skip to content

Commit

Permalink
Polyfill promise so sleep() works on 4.05
Browse files Browse the repository at this point in the history
  • Loading branch information
Al-Azif committed Mar 2, 2019
1 parent b468527 commit 94ccee5
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion themes/Default/common.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 1 addition & 4 deletions themes/Default/common.js.es6
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,7 @@ function uuid() {

// eslint-disable-next-line no-unused-vars
function sleep(time) {
if (typeof Promise !== 'undefined' && Promise.toString().indexOf('[native code]') !== -1) {
return new Promise((resolve) => { setTimeout(resolve, time); });
}
return undefined;
return new Promise((resolve) => { setTimeout(resolve, time); });
}

function getJson(inputURL) {
Expand Down
1 change: 1 addition & 0 deletions themes/Default/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ <h3 id="header">*</h3>
</div>
</div>
<iframe id="ifr" src="./blank.html"></iframe>
<script src="./themes/Default/promise-polyfill.min.js"></script>
<script src="./themes/Default/common.js"></script>
<script src="./themes/Default/default.js"></script>
</body>
Expand Down
1 change: 1 addition & 0 deletions themes/Default/promise-polyfill.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 94ccee5

Please sign in to comment.