The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

471639 (6) [Avatar] Offline
When I place the code in Listing 17.9 in a file (REPL.js) in my project, then run it in REPL using .load REPL.js (as directed two paragraphs above the Listing), it doesn't work.

It looks like line 11 is a complete, valid line of JavaScript, so REPL executes it without going into multi-line mode. However, line 12 is not valid code all by itself, so I get INVALID REPL KEYWORD.

This seems really simple, but is there some way to get this to work in REPL? What am I missing here?
471639 (6) [Avatar] Offline
I found what feels like a hack in a SO thread (second answer, I wrapped all of the code in:

if(1){ **Listing 17.9** }

It works, but feels icky.
TheWexler (62) [Avatar] Offline
I apologize for getting to this so late. I wasn't sure at which point this error occurred in the MEAP release cycle. I was just able to load and run repl.js in the final manuscript without errors. If you can copy and paste the code with which you experienced an issue, I can offer a more in depth analysis.