Fix a console error when importing in a browser

something about 'global' not defined
This commit is contained in:
Richard van der Hoff 2015-12-02 14:06:01 +00:00
parent 2bb7f3b1e6
commit a5fe3f605a

View file

@ -2,7 +2,7 @@ var olm_exports = {};
var get_random_values;
var process; // Shadow the process object so that emscripten won't get
// confused by browserify
if (global && global["window"]) {
if (typeof(global) !== 'undefined' && global["window"]) {
// We're running with browserify
module["exports"] = olm_exports;
global["window"]["Olm"] = olm_exports;