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", "name": "taler-wallet",
"version": "0.0.4", "version": "0.0.6",
"description": "", "description": "",
"main": "dist/node/index.js", "main": "dist/node/index.js",
"repository": { "repository": {

View File

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