const cArrayPointer = wasm.TS_malloc(inputArray.length + 8);
const arrayLengthView = new BigUint64Array(wasm.memory.buffer, cArrayPointer, 1);
arrayLengthView[0] = BigInt(inputArray.length);
const cArrayPointer = wasm.TS_malloc(inputArray.length + 8);
const arrayLengthView = new BigUint64Array(wasm.memory.buffer, cArrayPointer, 1);
arrayLengthView[0] = BigInt(inputArray.length);
const cArrayPointer = wasm.TS_malloc((inputArray.length + 2) * 4);
const arrayLengthView = new BigUint64Array(wasm.memory.buffer, cArrayPointer, 1);
arrayLengthView[0] = BigInt(inputArray.length);
const cArrayPointer = wasm.TS_malloc((inputArray.length + 2) * 4);
const arrayLengthView = new BigUint64Array(wasm.memory.buffer, cArrayPointer, 1);
arrayLengthView[0] = BigInt(inputArray.length);
const cArrayPointer = wasm.TS_malloc((inputArray.length + 1) * 8);
const arrayMemoryView = new BigUint64Array(wasm.memory.buffer, cArrayPointer, inputArray.length + 1);
arrayMemoryView[0] = BigInt(inputArray.length);
const cArrayPointer = wasm.TS_malloc((inputArray.length + 1) * 8);
const arrayMemoryView = new BigUint64Array(wasm.memory.buffer, cArrayPointer, inputArray.length + 1);
arrayMemoryView[0] = BigInt(inputArray.length);
-export function check_arr_len(arr: Uint8Array, len: number): Uint8Array {
- if (arr.length != len) { throw new Error("Expected array of length " + len + " got " + arr.length); }
+export function check_arr_len(arr: Uint8Array|null, len: number): Uint8Array {
+ if (arr !== null && arr.length != len) { throw new Error("Expected array of length " + len + " got " + arr.length); }
// In Java, protected means "any subclass can access fields on any other subclass'"
// In TypeScript, protected means "any subclass can access parent fields on instances of itself"
// To work around this, we add accessors for other instances' protected fields here.
// In Java, protected means "any subclass can access fields on any other subclass'"
// In TypeScript, protected means "any subclass can access parent fields on instances of itself"
// To work around this, we add accessors for other instances' protected fields here.
- protected static add_ref_from(holder: CommonBase, referent: object) {
- if (holder !== null) { holder.ptrs_to.push(referent); }
+ protected static add_ref_from(holder: CommonBase|null, referent: object|null) {
+ if (holder !== null && referent !== null) { holder.ptrs_to.push(referent); }