mirror of
https://github.com/jedisct1/libsodium.git
synced 2024-12-23 20:15:19 -07:00
this
may not be defined
This commit is contained in:
parent
2a367074fe
commit
af5ce360b4
@ -74,12 +74,22 @@ if [ "$DIST" = yes ]; then
|
||||
emccLibsodium "${PREFIX}/lib/libsodium.wasm.tmp.js" -O3 -s WASM=1
|
||||
|
||||
cat > "${PREFIX}/lib/libsodium.js" <<- EOM
|
||||
var Module;
|
||||
if (typeof Module === 'undefined') {
|
||||
var Module = {};
|
||||
Module = {};
|
||||
}
|
||||
var root = {};
|
||||
if (typeof this === 'object') {
|
||||
root = this.global || this.self || this.window || this;
|
||||
}
|
||||
if (typeof global === 'object') {
|
||||
root = global;
|
||||
}
|
||||
if (typeof window === 'object') {
|
||||
root = window;
|
||||
}
|
||||
var root = this.global || this.self || this.window || this;
|
||||
if (root.sodium && !isNaN(root.sodium.totalMemory)) {
|
||||
Module.TOTAL_MEMORY = root.sodium.totalMemory;
|
||||
Module['TOTAL_MEMORY'] = root.sodium.totalMemory;
|
||||
}
|
||||
var _Module = Module;
|
||||
Module.ready = new Promise(function (resolve, reject) {
|
||||
|
Loading…
Reference in New Issue
Block a user