diff --git a/src/export.js b/src/export.js index a2828545..6462dae4 100644 --- a/src/export.js +++ b/src/export.js @@ -27,9 +27,9 @@ paper = new (PaperScope.inject(Base.exports, { window: window }))(); -// If we're on node, require some additional functionality now (PaperScript -// support in require() with sourceMaps, and exportFrames / exportImage on -// CanvasView) +// If we're on node, require some additional functionality now before finishing: +// - PaperScript support in require() with sourceMaps +// - exportFrames / exportImage on CanvasView if (paper.agent.node) require('./node/extend')(paper); diff --git a/src/init.js b/src/init.js index e9a8160a..676fcfb7 100644 --- a/src/init.js +++ b/src/init.js @@ -10,8 +10,11 @@ * All rights reserved. */ -// Node.js emulation layer of browser based environment, based on node-canvas -// and jsdom. +// Here we only make sure that there's a window and document object in the node +// environment. We can't do this directly in src/paper.js, due to the nature of +// how Prepro.js loads the include() files in the various scenarios. E.g. on +// Node.js,only the files included in such a way see each other's variables in +// their shared scope. /* global document:true, window:true */ window = window || require('./node/window');