huajun07 / codesketcher

Visualise your code in action!
https://main.d1fr5et3wgts3j.amplifyapp.com/
MIT License
0 stars 0 forks source link

Fix/last line of function ignored #34

Closed limanjun99 closed 1 year ago

limanjun99 commented 1 year ago

This PR fixes this issue.

def func():
  a = 1
  b = 2

func()

The fix is to override the user_return function of the debugger, so that we can get the frame right after b = 2 is executed but before the function returns and local variables are dropped.

Added the testcase above to executor, and tested on the frontend too.

Screenshot 2023-06-07 at 12 44 23 PM