Skip to content

Commit dc0da30

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

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/convnet_export.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
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+
this.convnetjs = lib; // in ordinary browser attach library to window
55
} else {
66
module.exports = lib; // in nodejs
77
}

0 commit comments

Comments
 (0)