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; delete agent.webkit;
if (agent.atom) if (agent.atom)
delete agent.chrome; delete agent.chrome;
// In node context, JSDOM user agent no longer include "node" word, // In Node.js, the user agent set by JSDOM no longer includes `node`
// it is now called "jsdom". So we need to replace it because // but `jsdom` instead. Preserve `agent.node`:
// `agent.node` is expected to be true in node context. agent.node = agent.jsdom;
if (agent.jsdom) {
agent.node = true;
}
} }
}, },

View file

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