Skip to content

Commit

Permalink
small fixes to iroh example
Browse files Browse the repository at this point in the history
  • Loading branch information
GulnazSerikbay committed Oct 21, 2023
1 parent 893cd7d commit 8d7e068
Showing 1 changed file with 1 addition and 24 deletions.
25 changes: 1 addition & 24 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,33 +68,10 @@ stage.addListener(Iroh.CALL)
// console.log(e.getSource());
});

// function
stage.addListener(Iroh.FUNCTION)
.on('enter', (e) => {
const sloppy = e.sloppy ? '#sloppy' : '';
if (e.sloppy) {
console.log(`${' '.repeat(e.indent)}call`, e.name, sloppy, '(', e.arguments, ')');
// console.log(e.getSource());
}
})
.on('leave', (e) => {
const sloppy = e.sloppy ? '#sloppy' : '';
if (e.sloppy) {
console.log(`${' '.repeat(e.indent)}call`, e.name, 'end', sloppy, '->', [void 0]);
// console.log(e.getSource());
}
})
.on('return', (e) => {
const sloppy = e.sloppy ? '#sloppy' : '';
if (e.sloppy) {
console.log(`${' '.repeat(e.indent)}call`, e.name, 'end', sloppy, '->', [e.return]);
// console.log(e.getSource());
}
});

// program
stage.addListener(Iroh.PROGRAM)
.on('enter', (e) => {
console.log('Example code call trace with iroh: ');
console.log(`${' '.repeat(e.indent)}Program`);
})
.on('leave', (e) => {
Expand Down

0 comments on commit 8d7e068

Please sign in to comment.