aboutsummaryrefslogtreecommitdiff
path: root/lib/wallet/emscriptif.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2016-09-14 15:55:10 +0200
committerFlorian Dold <florian.dold@gmail.com>2016-09-14 15:55:10 +0200
commitebbdadb4b6bd59e57b0eec8e280c7c5c12453167 (patch)
tree8f9fdbd1cf0e2d1b79884dfe15828f3c98f28da6 /lib/wallet/emscriptif.ts
parentfc6db1824e6974898f177ffb0ffd2eb138a653ce (diff)
downloadwallet-core-ebbdadb4b6bd59e57b0eec8e280c7c5c12453167.tar.xz
sort out libs / fix warnings
Diffstat (limited to 'lib/wallet/emscriptif.ts')
-rw-r--r--lib/wallet/emscriptif.ts7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/wallet/emscriptif.ts b/lib/wallet/emscriptif.ts
index a12128666..34ef4d377 100644
--- a/lib/wallet/emscriptif.ts
+++ b/lib/wallet/emscriptif.ts
@@ -164,7 +164,7 @@ enum RandomQuality {
abstract class ArenaObject {
- private _nativePtr: number | undefined = undefined;
+ protected _nativePtr: number | undefined = undefined;
arena: Arena;
abstract destroy(): void;
@@ -440,7 +440,8 @@ abstract class PackedArenaObject extends ArenaObject {
}
alloc() {
- if (!this.nativePtr) {
+ super.alloc(this.size());
+ if (!this._nativePtr) {
this.nativePtr = emscAlloc.malloc(this.size());
}
}
@@ -775,7 +776,7 @@ export class AbsoluteTimeNbo extends PackedArenaObject {
x.alloc();
let r = /Date\(([0-9]+)\)/;
let m = r.exec(s);
- if (m.length != 2) {
+ if (!m || m.length != 2) {
throw Error();
}
let n = parseInt(m[1]) * 1000000;