Skip to content

Commit 1af80f5

Browse files
committed
fix
1 parent 4a7ae0a commit 1af80f5

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

src/utils/errorTraceHandler.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,12 @@ export async function handleWebAssemblyError(
113113
wasmPath: string
114114
): Promise<ExecutionError> {
115115
let stackTrace: NodeJS.CallSite[] = [];
116+
// eslint-disable-next-line @typescript-eslint/unbound-method
116117
const originalPrepareStackTrace = Error.prepareStackTrace;
117118
Error.prepareStackTrace = (_: Error, structuredStackTrace: NodeJS.CallSite[]) => {
118119
stackTrace = structuredStackTrace;
119120
};
121+
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
120122
error.stack; // trigger prepareStackTrace
121123
Error.prepareStackTrace = originalPrepareStackTrace;
122124

tests/e2e/run.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11
import assert from "node:assert";
22
import { exec } from "node:child_process";
3-
import { diffChars } from "diff";
3+
import { diffLines } from "diff";
44
import chalk from "chalk";
55
import { argv } from "node:process";
66
import { readFileSync } from "node:fs";
77

88
function getDiff(s1, s2) {
9-
const handleEscape = (c) => {
10-
if (c === "\n") return "\n'\\n'";
11-
return c;
12-
};
13-
return diffChars(s1, s2)
9+
const handleEscape = (c) => c.split("\n").map(l => l.length === 0 ? "\xB6" : l).join("\n")
10+
return diffLines(s1, s2)
1411
.map((part) => {
1512
if (part.added) {
1613
return chalk.bgGreen(handleEscape(part.value));

0 commit comments

Comments
 (0)