aboutsummaryrefslogtreecommitdiff
path: root/javascript/olm_suffix.js
diff options
context:
space:
mode:
authorDavid Baker <dave@matrix.org>2018-10-04 20:09:54 +0100
committerDavid Baker <dave@matrix.org>2018-10-04 20:09:54 +0100
commit602c00a8d658e8510e37e841dd06c70f276d0f00 (patch)
tree06ad0cb951a8c50e48325a7f75a58e83d4b3fc45 /javascript/olm_suffix.js
parent00384ba87a5943a8a12c9b8bfcb8903cc9be490f (diff)
Dual-build wasm and asm.js olm
Diffstat (limited to 'javascript/olm_suffix.js')
-rw-r--r--javascript/olm_suffix.js10
1 files changed, 6 insertions, 4 deletions
diff --git a/javascript/olm_suffix.js b/javascript/olm_suffix.js
index 7f19953..3e2f664 100644
--- a/javascript/olm_suffix.js
+++ b/javascript/olm_suffix.js
@@ -24,7 +24,9 @@ if (typeof(window) !== 'undefined') {
window["Olm"] = olm_exports;
}
-// 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;
+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;
+}