Check for createWindow presence. Closes #1790

This commit is contained in:
kangax 2014-11-01 17:41:01 +01:00
parent 1d7cfefba1
commit 70c6d5b030

View file

@ -14,7 +14,9 @@ else {
fabric.document = require("jsdom")
.jsdom("<!DOCTYPE html><html><head></head><body></body></html>");
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