From 6a099003b22b58ceacd90f2a382e4c295f0392d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Tue, 26 Jan 2016 20:14:49 +0100 Subject: [PATCH] Improve some comments about new file structure. --- src/export.js | 6 +++--- src/init.js | 7 +++++-- 2 files changed, 8 insertions(+), 5 deletions(-) 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');