WebAssembly support!
Quite a lot going on in this PR: * Updates to support recent emscripten, switching to WASM which is now the default * Use emscripten's MODULARIZE option rather than wrapping it ourself, since doing so in pre-post js doesn't work anymore. * Most changes are moving the emscripten runtime functions to top-level calls rather than in the Module object. * Get rid of duplicated NULL_BYTE_PADDING_LENGTH * Fix ciphertext_length used without being declared * Fix things that caused the closure compiler to error, eg. using OLM_OPTIONS without a declaration. * Wait until module is inited to do OLM_ERROR = olm_error() The main BREAKING CHANGE here is that the module now needs to initialise asyncronously (because it has to load the wasm file). require()ing olm now gives a function which needs to be called to create an instance. The resulting object has a promise-like then() method that can be used to detect when the module is ready. (We could use MODULARIZE_INSTANCE to return the module directly as before, rather than the function, but then we don't get the .then() method).
Showing
- Makefile 3 additions, 1 deletionMakefile
- javascript/.gitignore 1 addition, 0 deletionsjavascript/.gitignore
- javascript/olm_inbound_group_session.js 4 additions, 10 deletionsjavascript/olm_inbound_group_session.js
- javascript/olm_outbound_group_session.js 4 additions, 11 deletionsjavascript/olm_outbound_group_session.js
- javascript/olm_pk.js 10 additions, 10 deletionsjavascript/olm_pk.js
- javascript/olm_post.js 21 additions, 25 deletionsjavascript/olm_post.js
- javascript/olm_pre.js 22 additions, 13 deletionsjavascript/olm_pre.js
- javascript/test/megolm.spec.js 5 additions, 2 deletionsjavascript/test/megolm.spec.js
- javascript/test/olm.spec.js 8 additions, 2 deletionsjavascript/test/olm.spec.js
- javascript/test/pk.spec.js 6 additions, 2 deletionsjavascript/test/pk.spec.js
Loading
Please register or sign in to comment