Closed 1j01 closed 1 year ago
This line throws ReferenceError: UZIP is not defined: https://github.com/photopea/UPNG.js/blob/a4eafb5c77072162be3a6d968ac67d238a9d01ac/UPNG.js#L813
ReferenceError: UZIP is not defined
It should use typeof to safely check for the existence of a global, like so:
typeof
var CMPR = (data.length>10e6 && typeof UZIP!="undefined" && UZIP!=null) ? UZIP : pako;
The UZIP!=null part is still useful in case for example anyone was working around this by setting window.UZIP = null;
UZIP!=null
window.UZIP = null;
What if I check
window.UZIP!=null
that should work, right?
Yes, that should be fine. The only difference would be in non-browser environments, which probably aren't supported.
Ok, I have uploaded a new version.
This line throws
ReferenceError: UZIP is not defined
: https://github.com/photopea/UPNG.js/blob/a4eafb5c77072162be3a6d968ac67d238a9d01ac/UPNG.js#L813It should use
typeof
to safely check for the existence of a global, like so:The
UZIP!=null
part is still useful in case for example anyone was working around this by settingwindow.UZIP = null;