File tree Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -113,10 +113,12 @@ export async function handleWebAssemblyError(
113
113
wasmPath : string
114
114
) : Promise < ExecutionError > {
115
115
let stackTrace : NodeJS . CallSite [ ] = [ ] ;
116
+ // eslint-disable-next-line @typescript-eslint/unbound-method
116
117
const originalPrepareStackTrace = Error . prepareStackTrace ;
117
118
Error . prepareStackTrace = ( _ : Error , structuredStackTrace : NodeJS . CallSite [ ] ) => {
118
119
stackTrace = structuredStackTrace ;
119
120
} ;
121
+ // eslint-disable-next-line @typescript-eslint/no-unused-expressions
120
122
error . stack ; // trigger prepareStackTrace
121
123
Error . prepareStackTrace = originalPrepareStackTrace ;
122
124
Original file line number Diff line number Diff line change 1
1
import assert from "node:assert" ;
2
2
import { exec } from "node:child_process" ;
3
- import { diffChars } from "diff" ;
3
+ import { diffLines } from "diff" ;
4
4
import chalk from "chalk" ;
5
5
import { argv } from "node:process" ;
6
6
import { readFileSync } from "node:fs" ;
7
7
8
8
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 )
14
11
. map ( ( part ) => {
15
12
if ( part . added ) {
16
13
return chalk . bgGreen ( handleEscape ( part . value ) ) ;
You can’t perform that action at this time.
0 commit comments