From f226f13db2604c51f43d35f488b7528f116ef438 Mon Sep 17 00:00:00 2001 From: cpansprout Date: Sat, 3 Jun 2017 06:52:13 -0700 Subject: [PATCH] Allow to work in non-browser env MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ‘window’ is specific to browser environments. The convnetjs variable has already been made into a global variable at this point, so the assignment is redundant. This allows it to work in non-browser environments other than node. --- src/convnet_export.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/convnet_export.js b/src/convnet_export.js index 5d3ffb83..ac35d731 100644 --- a/src/convnet_export.js +++ b/src/convnet_export.js @@ -1,7 +1,8 @@ (function(lib) { "use strict"; if (typeof module === "undefined" || typeof module.exports === "undefined") { - window.convnetjs = lib; // in ordinary browser attach library to window + // By declaring convnetjs globally, we have already made it available. + // Nothing to do here. } else { module.exports = lib; // in nodejs }