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. ‘this’ (the global object is the default ‘this’ value) allows it to work in non-browser environments other than node.
  • Loading branch information
cpansprout authored Jun 3, 2017
1 parent 4c3358a commit dc0da30
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 dc0da30

Please sign in to comment.