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

Unexpected parse error inside deno REPL #17442

Closed
Shifta-Robel opened this issue Jan 16, 2023 · 1 comment · Fixed by #17443
Closed

Unexpected parse error inside deno REPL #17442

Shifta-Robel opened this issue Jan 16, 2023 · 1 comment · Fixed by #17443

Comments

@Shifta-Robel
Copy link

This piece of code

> function mergeSort(arr){
     if( arr.length <= 1) return arr
     let left = mergeSort( arr.slice( 0 , arr.length/2 ) )

keeps giving parse error: Expected '}', got '<eof>' at 3:50, can't seem to go past it without using Ctrl+S.
And it works fine in node

@aapoalas
Copy link
Collaborator

Minor clarification: The issue is that Deno's REPL doesn't automatically insert a line break with this input but instead tries to interpret the whole code as a complete command, which it is not as it is missing the closing brace for the mergeSort function.

Node's REPL correctly infers that an Enter press should insert a line break, not evaluate the code.

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

Successfully merging a pull request may close this issue.

2 participants