aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Haines <mark.haines@matrix.org>2015-07-21 14:30:46 +0100
committerMark Haines <mark.haines@matrix.org>2015-07-21 14:30:46 +0100
commit5a60e543a5a1729833f61fb696d2374557788db5 (patch)
treec5b0a713854dbcdaeec44b58abbbe5b73e1b7d4c
parentbb70307b11bb7d8e69ef8ac50ee1d870cd12c286 (diff)
Add more workarounds for closure compiler in javascript bindings
-rw-r--r--javascript/olm_pre.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/javascript/olm_pre.js b/javascript/olm_pre.js
index cab59f0..7706687 100644
--- a/javascript/olm_pre.js
+++ b/javascript/olm_pre.js
@@ -2,10 +2,10 @@ 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 (global && global["window"]) {
// We're running with browserify
module["exports"] = olm_exports;
- global.window["Olm"] = olm_exports;
+ global["window"]["Olm"] = olm_exports;
get_random_values = function(buf) {
window.crypto.getRandomValues(buf);
};
@@ -23,7 +23,7 @@ if (global && global.window) {
var bytes = nodeCrypto.randomBytes(buf.length);
buf.set(bytes);
}
- process = global.process;
+ process = global["process"];
} else {
throw new Error("Cannot find global to attach library to");
}