Open BeeDice opened 9 months ago
To reproduce:
<head> <script type="module"> import('https://cdnjs.cloudflare.com/ajax/libs/jsmediatags/3.9.5/jsmediatags.min.js'); </script> </head>
Error:
Uncaught TypeError: Cannot use 'in' operator to search for 'Object' in undefined at $jscomp.polyfill (jsmediatags.min.js:2:113) at jsmediatags.min.js:2:257
Reason is that this is undefined in ES6 modules:
this
undefined
$jscomp.global = $jscomp.getGlobal(this); // === undefined
I understand we use this here to support Node. Can getGlobal() return window if it is passed undefined?
getGlobal()
window
This.
To reproduce:
Error:
Reason is that
this
isundefined
in ES6 modules:I understand we use
this
here to support Node. CangetGlobal()
returnwindow
if it is passedundefined
?