Skip to content

Commit

Permalink
curScript correction for async and defer
Browse files Browse the repository at this point in the history
  • Loading branch information
guybedford committed Jul 19, 2016
1 parent 4933661 commit adb5fda
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/wrapper-end.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ var doPolyfill = typeof Promise === 'undefined';
if (typeof document !== 'undefined') {
var scripts = document.getElementsByTagName('script');
$__curScript = scripts[scripts.length - 1];
if ($__curScript.defer || $__curScript.async)
$__curScript = document.currentScript;
if (doPolyfill) {
var curPath = $__curScript.src;
var basePath = curPath.substr(0, curPath.lastIndexOf('/') + 1);
Expand Down

0 comments on commit adb5fda

Please sign in to comment.