Minor comment fixes

This commit is contained in:
Jürg Lehni 2019-06-05 20:03:11 +02:00
parent bdc311e99f
commit 5e64b78e40
2 changed files with 6 additions and 9 deletions

View file

@ -105,12 +105,9 @@ var PaperScope = Base.extend(/** @lends PaperScope# */{
delete agent.webkit;
if (agent.atom)
delete agent.chrome;
// In node context, JSDOM user agent no longer include "node" word,
// it is now called "jsdom". So we need to replace it because
// `agent.node` is expected to be true in node context.
if (agent.jsdom) {
agent.node = true;
}
// In Node.js, the user agent set by JSDOM no longer includes `node`
// but `jsdom` instead. Preserve `agent.node`:
agent.node = agent.jsdom;
}
},

View file

@ -408,9 +408,9 @@ var Raster = Item.extend(/** @lends Raster# */{
crossOrigin = this._crossOrigin;
if (crossOrigin)
image.crossOrigin = crossOrigin;
// Prevent setting image source to `null`, as this isn't supported by browsers,
// and it would actually throw exceptions in JSDOM.
//TODO: Look into fixing this exception in JSDOM
// Prevent setting image source to `null`, as this isn't supported by
// browsers, and it would actually throw exceptions in JSDOM.
// TODO: Look into fixing this bug in JSDOM.
if (src)
image.src = src;
this.setImage(image);