Merge pull request #1451 from PhilippMi/ie-async-scripts

Check for document.currentScript before assigning it
This commit is contained in:
Guy Bedford 2016-09-19 17:19:06 +02:00 committed by GitHub
commit 530c9ea192

View File

@ -7,7 +7,7 @@ var doPolyfill = typeof Promise === 'undefined';
if (typeof document !== 'undefined') {
var scripts = document.getElementsByTagName('script');
$__curScript = scripts[scripts.length - 1];
if ($__curScript.defer || $__curScript.async)
if (document.currentScript && ($__curScript.defer || $__curScript.async))
$__curScript = document.currentScript;
if (doPolyfill) {
var curPath = $__curScript.src;