New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: option for only-last-statement evaluation #24

Open
getify opened this Issue Jan 8, 2019 · 1 comment

Comments

Projects
None yet
2 participants
@getify
Copy link

getify commented Jan 8, 2019

I would like an option to switch on a mode like how browser devtools consoles only evaluate the last statement in a snippet, because sometimes you have a bunch of statements in a snippet of code that you don't want to evaluate, but only want to evaluate the last statement.

Consider the differences between these two:

screen shot 2019-01-08 at 10 38 15 am

screen shot 2019-01-08 at 10 38 44 am

In RunJS, it outputs the result of the x = foo() statement (which is just another function), and then also evaluates both x() calls. In the Chrome console, it only evaluates the last x() call.

Sometimes, I want the behavior of the former, sometimes I want the behavior of the latter. It would be really nice to have an option to toggle between both modes.

@lukehaas

This comment has been minimized.

Copy link
Owner

lukehaas commented Jan 8, 2019

Makes sense.
I'll create an option for line-by-line evaluation, defaulting to true.

@lukehaas lukehaas added the enhancement label Jan 8, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment