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

If you backspace over the INPUT prompt "? " and enter text it hangs or throws a JS exception #47

Open
mobluse opened this issue Feb 5, 2022 · 0 comments

Comments

@mobluse
Copy link

mobluse commented Feb 5, 2022

If you backspace over the INPUT prompt "? " and enter text it hangs or throws a JS exception. Run the test program below and press BACKSPACE once and then e.g. P and Enter; the browser tab hangs after a while. If you delete more before entering text, you get: "EXCEPTION RangeError: Invalid string length". I think it would be better if backing over the prompt was disallowed (as it is in your pcbasic) or it didn't hang or threw an exception, but instead sent the typed characters and ignored more backspaces than was needed. Now there is a great risk that a user hangs a program that they have worked with, to get a result, for a long time.
2022-02-06-001601_710x904_scrot

1000 A=100: GOTO 20: REM INPUT TEST
1010 INPUT "ENTER A STRING";A$
1020 PRINT "THE STRING IS: ";A$
1030 GOTO 1010
30000 REM DEMONSTRATES A BUG IN INPUT
30010 REM ENTER BACKSPACE AND A CHARACTER AND ENTER: IT HANGS.
30030 REM ENTER SEVERAL BACKSPACES AND A CHARACTER: A JS EXCEPTION.
30040 REM WHAT I EXPECTED: EITHER THAT BACKSPACE WOULDN'T BACK
30050 REM OVER THE PROMPT "? ", OR THAT IT WOULD ACCEPT THE TYPED
30060 REM CHARACTERS AS INPUT.

I use Chromium Version 92.0.4515.98 (Official Build) Built on Raspbian , running on Raspbian 10 (32-bit), on Raspberry Pi 4 B 8 GiB.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant