Skip to content

Commit

Permalink
Allow to work in non-browser env
Browse files Browse the repository at this point in the history
‘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.
  • Loading branch information
cpansprout authored and sprout committed Jun 25, 2017
1 parent 4c3358a commit 1670767
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/convnet_export.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
(function(lib) {
"use strict";
if (typeof module === "undefined" || typeof module.exports === "undefined") {
window.convnetjs = lib; // in ordinary browser attach library to window
this.convnetjs = lib; // in ordinary browser attach library to window
} else {
module.exports = lib; // in nodejs
}
Expand Down

0 comments on commit 1670767

Please sign in to comment.