Skip to content

Commit f226f13

Browse files
cpansproutsprout
authored andcommitted
Allow to work in non-browser env
‘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.
1 parent 4c3358a commit f226f13

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/convnet_export.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
(function(lib) {
22
"use strict";
33
if (typeof module === "undefined" || typeof module.exports === "undefined") {
4-
window.convnetjs = lib; // in ordinary browser attach library to window
4+
// By declaring convnetjs globally, we have already made it available.
5+
// Nothing to do here.
56
} else {
67
module.exports = lib; // in nodejs
78
}

0 commit comments

Comments
 (0)