emscripten env consistency

This commit is contained in:
Florian Dold 2019-08-16 00:54:48 +02:00
parent cc4eeec031
commit 0049a240e7
No known key found for this signature in database
GPG Key ID: D2E4F00F29D02A4B
2 changed files with 9 additions and 2 deletions

View File

@ -1,6 +1,6 @@
{
"name": "taler-wallet",
"version": "0.0.4",
"version": "0.0.6",
"description": "",
"main": "dist/node/index.js",
"repository": {

View File

@ -102,14 +102,21 @@ export class SynchronousCryptoWorker {
const savedImportScripts = g.importScripts;
// @ts-ignore
delete g.importScripts;
// @ts-ignore
const savedCrypto = g.crypto;
// @ts-ignore
delete g.crypto;
// Assume that the code is run from the build/ directory.
const libFn = indirectRequire(
"../../../emscripten/taler-emscripten-lib.js",
);
const lib = libFn(libArgs);
lib = libFn(libArgs);
// @ts-ignore
g.importScripts = savedImportScripts;
// @ts-ignore
g.crypto = savedCrypto;
if (!lib) {
throw Error("could not load taler-emscripten-lib.js");