Merge pull request #9588 from swftvsn/patch-1

Improve node.js support
This commit is contained in:
Tim van der Meij 2018-04-01 12:26:39 +02:00 committed by GitHub
commit 8887a09e8f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2112,8 +2112,9 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
var heightScale = Math.max(Math.sqrt(c * c + d * d), 1);
var imgToPaint, tmpCanvas;
// instanceof HTMLElement does not work in jsdom node.js module
if (imgData instanceof HTMLElement || !imgData.data) {
// typeof check is needed due to node.js support, see issue #8489
if ((typeof HTMLElement === 'function' &&
imgData instanceof HTMLElement) || !imgData.data) {
imgToPaint = imgData;
} else {
tmpCanvas = this.cachedCanvases.getCanvas('inlineImage',