File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -5,13 +5,16 @@ export function strace<T extends object>(
55 return new Proxy ( imports , {
66 get ( target , prop , receiver ) {
77 const f = Reflect . get ( target , prop , receiver ) ;
8- if ( no_trace . includes ( prop ) ) {
8+ if ( no_trace . includes ( prop ) || typeof f !== "function" ) {
99 return f ;
1010 }
11- return function ( ...args : undefined [ ] ) {
11+ return ( ...args : unknown [ ] ) => {
1212 console . log ( prop , "(" , ...args , ")" ) ;
13- // eslint-disable-next-line @typescript-eslint/ban-types
14- const result = Reflect . apply ( f as Function , receiver , args ) ;
13+ const result = Reflect . apply (
14+ f as ( ...fnArgs : unknown [ ] ) => unknown ,
15+ receiver ,
16+ args ,
17+ ) ;
1518 console . log ( " =" , result ) ;
1619 return result ;
1720 } ;
Original file line number Diff line number Diff line change @@ -169,7 +169,7 @@ export default class WASI {
169169 let monotonic_time : bigint ;
170170 try {
171171 monotonic_time = BigInt ( Math . round ( performance . now ( ) * 1000000 ) ) ;
172- } catch ( e ) {
172+ } catch {
173173 // performance.now() is only available in browsers.
174174 // TODO use the perf_hooks builtin module for NodeJS
175175 monotonic_time = 0n ;
You can’t perform that action at this time.
0 commit comments