Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions packages/@wterm/core/src/wasm-bridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ export class WasmBridge implements TerminalCore {
private maxCols = 256;
private encoder = new TextEncoder();
private decoder = new TextDecoder();
private _dv!: DataView;

constructor(instance: WebAssembly.Instance) {
this.exports = instance.exports as unknown as WasmExports;
Expand Down Expand Up @@ -93,7 +92,6 @@ export class WasmBridge implements TerminalCore {
this.writeBufferPtr = this.exports.getWriteBuffer();
this.cellSize = this.exports.getCellSize();
this.maxCols = this.exports.getMaxCols();
this._dv = new DataView(this.memory.buffer);
}

writeString(str: string): void {
Expand All @@ -114,7 +112,7 @@ export class WasmBridge implements TerminalCore {

getCell(row: number, col: number): CellData {
const offset = this.gridPtr + (row * this.maxCols + col) * this.cellSize;
const dv = this._dv;
const dv = new DataView(this.memory.buffer);
return {
char: dv.getUint32(offset, true),
fg: dv.getUint16(offset + 4, true),
Expand Down Expand Up @@ -181,7 +179,7 @@ export class WasmBridge implements TerminalCore {
getScrollbackCell(offset: number, col: number): CellData {
const ptr = this.exports.getScrollbackLine(offset);
const off = ptr + col * this.cellSize;
const dv = this._dv;
const dv = new DataView(this.memory.buffer);
return {
char: dv.getUint32(off, true),
fg: dv.getUint16(off + 4, true),
Expand Down