Skip to content
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

printing doesn't work on mac #48

Closed
Almenon opened this issue Oct 28, 2017 · 1 comment
Closed

printing doesn't work on mac #48

Almenon opened this issue Oct 28, 2017 · 1 comment
Assignees
Labels

Comments

@Almenon
Copy link
Owner

Almenon commented Oct 28, 2017

When anything is printed the last character is left off.

print('hello world')

hello worl

@Almenon Almenon added the bug label Oct 28, 2017
@Almenon Almenon added this to the v1.0.0-alpha.6 milestone Oct 28, 2017
@Almenon Almenon self-assigned this Oct 28, 2017
@Almenon
Copy link
Owner Author

Almenon commented Oct 28, 2017

Found the problem:
https://github.com/Almenon/AREPL/blob/09dc88a3f887fc7868438f7cc85045cac8975a39/src/evaluators.js#L152
https://github.com/Almenon/AREPL/blob/09dc88a3f887fc7868438f7cc85045cac8975a39/src/evaluators.js#L153

Mac doesn't have \r, that's just a windows thing. Darnit windows!

If I had a used a defensive programming style (by checking for existance of \r before removing) I could have avoided this bug. Anyways, fix is very easy:

	if(results.endsWith('\r')) results = results.slice(0, results.length-1);

Almenon added a commit that referenced this issue Oct 28, 2017
@Almenon Almenon closed this as completed Oct 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant