Question

Sometimes, when you type enter after a correct finished statement, the REPL waits for more :

> var f; function(){};
... 

When exactly does that happen ? I didn't found any documentation on that.

Was it helpful?

Solution

Your code is not correct. When run from a file, a syntax error is reported:

SyntaxError: Unexpected token (

There was a bug in REPL where in the case of a syntax error, REPL assumed the code to evaluate is not complete and would span multiple lines. Regardless of the type of syntax error.

The issue was fixed in v0.11.7 by commit 9ef9a9d. See the commit message for more details.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top