From 70c6d5b0301121aa551c666c136167f3a4a8cc9d Mon Sep 17 00:00:00 2001 From: kangax Date: Sat, 1 Nov 2014 17:41:01 +0100 Subject: [PATCH] Check for createWindow presence. Closes #1790 --- HEADER.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/HEADER.js b/HEADER.js index 6204b0d7..deca0d31 100644 --- a/HEADER.js +++ b/HEADER.js @@ -14,7 +14,9 @@ else { fabric.document = require("jsdom") .jsdom(""); - fabric.window = fabric.document.createWindow(); + if (fabric.document.createWindow) { + fabric.window = fabric.document.createWindow(); + } } /** @@ -30,7 +32,6 @@ fabric.isTouchSupported = "ontouchstart" in fabric.document.documentElement; fabric.isLikelyNode = typeof Buffer !== 'undefined' && typeof window === 'undefined'; - /** * Attributes parsed from all SVG elements * @type array