aboutsummaryrefslogtreecommitdiff
path: root/javascript
diff options
context:
space:
mode:
authorRichard van der Hoff <richard@matrix.org>2016-12-14 11:41:51 +0000
committerRichard van der Hoff <richard@matrix.org>2016-12-14 11:46:12 +0000
commit51b141ecb6b473dd4fd8425ca08f8dbc590a01c0 (patch)
tree9a3a2f60fed411f9e6fca867691fa63a1db39d79 /javascript
parent1bf807bf33b2a407e4d8a3f9785b522b5d384913 (diff)
Let apps override emscripten settings
Read settings from OLM_OPTIONS to allow apps to configure some options. In particular, this is useful for setting the heap size.
Diffstat (limited to 'javascript')
-rw-r--r--javascript/olm_pre.js12
1 files changed, 10 insertions, 2 deletions
diff --git a/javascript/olm_pre.js b/javascript/olm_pre.js
index 611488b..ae7aba5 100644
--- a/javascript/olm_pre.js
+++ b/javascript/olm_pre.js
@@ -21,5 +21,13 @@ if (typeof(window) !== 'undefined') {
}
(function() {
- var module; // Shadow the Node 'module' object so that emscripten won't try
- // to fiddle with it.
+ /* applications should define OLM_OPTIONS in the environment to override
+ * emscripten module settings */
+ var Module = {};
+ if (typeof(OLM_OPTIONS) !== 'undefined') {
+ for (var key in OLM_OPTIONS) {
+ if (OLM_OPTIONS.hasOwnProperty(key)) {
+ Module[key] = OLM_OPTIONS[key];
+ }
+ }
+ }