Commit 6611165b authored by Lukas Lihotzki's avatar Lukas Lihotzki

do not pollute the global object

parent add885c8
var Olm = (function() {
var olm_exports = {};
var onInitSuccess;
var onInitFail;
......@@ -17,16 +17,20 @@ olm_exports['init'] = function(opts) {
return olmInitPromise;
};
return olm_exports;
})();
if (typeof(window) !== 'undefined') {
// We've been imported directly into a browser. Define the global 'Olm' object.
// (we do this even if module.exports was defined, because it's useful to have
// Olm in the global scope for browserified and webpacked apps.)
window["Olm"] = olm_exports;
window["Olm"] = Olm;
}
if (typeof module === 'object') {
// Emscripten sets the module exports to be its module
// with wrapped c functions. Clobber it with our higher
// level wrapper class.
module.exports = olm_exports;
module.exports = Olm;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment